下沉:使用Facebook个人资料照片为您的Google联系人提供高分辨率照片

  • o7_793035
    了解作者
  • 8.6KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-07 04:26
    上传日期
水槽 Sink是一个实用程序,使用Facebook个人资料图片为您的Google联系人提供高分辨率照片。 Sink将您的每个Google联系人与他们的Facebook个人资料链接起来,并存储这些链接以进行快速更新。 安装 要安装所需的依赖项,请运行以下命令。 这仅需要执行一次。 $ pip install -r requirements.txt Google OAuth2凭证 接收器需要OAuth2凭据才能访问您的Google帐户。 要获取OAuth2凭据,您需要在创建OAuth2应用程序。 获取OAuth2凭据后,分别将SINK_CLIENT_ID和SINK_CLIENT_SECRET环
sink-master.zip
  • sink-master
  • README.md
    7KB
  • requirements.txt
    95B
  • .gitignore
    16B
  • sink.py
    20.8KB
内容介绍
# Sink Sink is a utility that uses Facebook profile pictures to provide high resolution photos for your Google contacts. Sink links each of your Google contacts with their Facebook profile and stores those links to allow for quick updates. ## Installation To install the required dependencies, run the following command. This only needs to be done once. $ pip install -r requirements.txt ### Google OAuth2 Credentials Sink requires OAuth2 credentials in order to access your Google account. To obtain OAuth2 credentials, you will need to create an OAuth2 application in the [Google API console](https://console.developers.google.com/). After obtaining OAuth2 credentials, set the `SINK_CLIENT_ID` and `SINK_CLIENT_SECRET` environment variables to the client ID and client secret, respectively. Sink reads these environment variables to obtain the client ID and client secret. ## Usage When run for the first time, Sink will request permission to manage your contacts and ask for your Facebook username and password. This is necessary to be able to access your accounts. Sink will also create a database which contains these credentials and all created links created between Google contacts and Facebook friends. This database is automatically updated anytime Sink is run. **This data is not stored securely or protected in any way. Secure your computer account to protect access to your database and do not share it others.** ### Basic Usage To update your contact photos simply invoke the following command $ python sink.py update ### Commands The following provides details on each of the Sink commands. To view information about the possible commands invoke help $ python sink.py -h #### Update The update command updates your links and contact photos. This command first creates links for all Google contacts that are not already stored in the database. It attempts to automatically link contacts with Facebook friends by matching Google contact names with Facebook friend names. You will then be prompted to manually link or ignore all contacts that could not be automatically linked. Once all contacts have been linked your contact photos will be updated according to the created links. The Sink update command is invoked by the following command $ python sink.py update [filename] [-a] [-i] [-s SCORE] [-m MATCHES] [-r RETRIES] [-d DELAY] [-e EXPIRY] ###### Optional Arguments * `filename` - the name of shelf database file to use. Defaults to `sinkshelf`. * `-a, --auto-only` - skip all contacts not automatically linked. This is useful when running Sink automatically so it does not prompt for user input. * `-i, --update-ignored` - update all contacts previously ignored. This is useful when you previously ignored a contact but recently became Facebook friends. * `-s SCORE, --score SCORE` - score threshold to automatically link contacts. Must be between 0 and 100. The higher this number, the more similar contact and friends names must be to be automatically linked. Defaults to 100 (perfect match). * `-m MATCHES, --matches MATCHES` - the number of results to show when searching for friends to link to a contact. Defaults to 5. * `-r RETRIES, --retries RETRIES` - number of times to retry updating photos before failing. Defaults to 3. * `-d DELAY, --delay DELAY` - number of seconds to wait between contacts when updating photos. Defaults to 0. * `-e EXPIRY, --expiry EXPIRY` - number of days a photo is considered current and should not be updated. Defaults to 30. To view information about the Sink update command invoke help $ python sink.py update -h #### Edit The edit command allows you to edit your existing links. You will be prompted to select a contact and then manually link or ignore that contact. The Sink edit command is invoked by the following command $ python sink.py edit [filename] [-s SCORE] [-m MATCHES] ###### Optional Arguments * `filename` - the name of shelf database file to use. Defaults to `sinkshelf`. * `-s SCORE, --score SCORE` - score threshold to automatically link contacts. Must be between 0 and 100. The higher this number, the more similar contact and friends names must be to be automatically linked. Defaults to 100 (perfect match). * `-m MATCHES, --matches MATCHES` - the number of results to show when searching for friends to link to a contact. Defaults to 5. To view information about the Sink edit command invoke help $ python sink.py edit -h #### Delete The delete command delete all Google contact photos provided by Sink. Optionally, it will also delete all links saved in the database. The Sink delete command is invoked by the following command $ python sink.py delete [filename] [-l] [-r RETRIES] ###### Optional Arguments * `filename` - the name of shelf database file to use. Defaults to `sinkshelf`. * `-l, --delete-links` - delete saved links. * `-r RETRIES, --retries RETRIES` - number of times to retry updating photos before failing. Defaults to 3. To view information about the Sink delete command invoke help $ python sink.py delete -h ## Implementation Details #### Facebook Sink scrapes your Facebook profile friends page to obtain a list of your friends' names and their Facebook usernames. These usernames are then used to scrape your friends' profile pages to obtain their user ID. This ID is then used to query the [Facebook Graph API](https://developers.facebook.com/docs/graph-api) (specifically [User Picture](https://developers.facebook.com/docs/graph-api/reference/user/picture)) to obtain their profile picture. #### Google Contacts Sink uses the [Google Contacts API](https://developers.google.com/google-apps/contacts) through the [Google Data Python Library](https://github.com/google/gdata-python-client). Sink requests an OAuth token when run for the first time. This token is then stored in the shelf database and used in future invocations. Sink temporarily runs a minimal HTTP server listening on port 7465 when requesting an OAuth token in order to receive the response containing the token data. The port listened on by the server can be changed in the source code. #### Data Storage Sink uses the [shelve](https://docs.python.org/library/shelve.html) module in the Python standard library to persist data between Sink invocations. The created shelf database stores the following information: * Facebook username * Facebook password * Google OAuth token * Created links between Google contacts and Facebook friends **This data is not stored securely or protected in any way. Protect access to your shelf database and do not share it others.** This is because Sink needs to be able to read your Facebook username and password in order to scrape friend data. Securing the shelf database would require user authentication on every invocation of Sink, which is inconvenient. This is not a security concern because Sink is intended to be run locally so the shelf database file will be stored in a directory accessible only to the intended user. To protect your shelf database take the appropriate steps to secure your computer user account.
评论
    相关推荐
    • CProgrammingNotes:这是Facebook C编程组的C存储
      #C编程说明 小组的注意事项: :
    • Facebook开源的时序数据库存储引擎Beringei.zip
      Beringei 是一个高性能的、内存型的时序数据库存储引擎。时间序列通常用作统计,仪表和计数器的表示,用于监视系统的性能和运行状况。Beringei 有以下特性:支持非常快的内存存储,由磁盘支持持久化非常高效的流压缩...
    • DeleteFB:自动清理您的Facebook状态
      我无法保证Facebook不会将数据永远存储在冷存储中。 但是,此工具的目的更多是为了清理您的在线形象,而不必担心您几年前写的内容。 就我个人而言,我这样做是为了减少与我的Facebook个人资料的联系(因此感到需要...
    • Facebook的WindowsSDKwinsdkfb.zip
      winsdkfb 是为 Facebook 准备的 Windows SDK,允许开发者集成 Facebook 到 Windows 应用。支持功能:认证登录退出 登录按钮 资料图片控制 对话框反馈对话框 请求对话框 图像自定义存储回复用户反馈 上传图片 类似 ...
    • Facebook Fresco
      Fresco是Facebook最新推出的一款用于Android应用中展示图片的强大图片库,可以从网络、本地存储和本地资源中加载图片。其中的Drawees可以显示占位符,直到图片加载完成。而当图片从屏幕上消失时,会自动释放内存。
    • facebook-clone
      用于和存储的多个后端。 富有表现力,直观的 。 数据库不可知。 。 。 Laravel易于访问,功能强大,并提供大型,强大的应用程序所需的工具。 学习Laravel Laravel拥有所有现代Web应用程序框架中最广泛,最...
    • Messer:Facebook Messenger的命令行消息传递
      Facebook Messenger的命令行消息传递 Messer是您的终端的功能丰富的Facebook Messenger客户端。 发送和接收消息,查看聊天记录等等! 安装 $ npm install -g messer 快速开始 需要node版本12.x 安装messer 运行...
    • Facebook-CryptD-Messages:Facebook的CryptD消息
      下载存储库中所有文件的zip版本 在任何地方提取下载的文件 打开您的Chromium或Chrome浏览器,然后转到“设置”>“扩展程序” 启用开发人员模式以能够添加解压缩的扩展 单击“加载解压缩的扩展名”按钮,然后导航到...
    • react-localstorage:Facebook的React的简单的组件化本地存储实现
      React本地存储 只需将组件的状态与localStorage同步(如果可用)。 这是一种老式的Mixin,这意味着它可能已经与您的React应用程序兼容了几年。 如果您是一位年轻的程序员,则可能更喜欢。 安装 npm i react-...
    • GaussDB_100_1.0.1-DATABASE-REDHAT-64bit.tar.gz
      guassdb100在redhat上安装包,单机部署的包,安装步骤请看我的文中介绍,经过大量实验搭建总结出来的文档