每当Facebook页面添加新事件时,都会收到电子邮件通知。
ihatefacebook的Python项目详细描述
iHateFacebook
ihatefacebok是一个python脚本,允许您在facebook页面添加新事件时通过电子邮件获得通知,
不用自己和facebook互动。默认情况下,每次启动计算机时脚本都会运行
(登录后),但也可以使用run
命令将其设置为cron
作业。目前只支持MacOS。
安装
$ pip install ihatefacebook
用法
$ ihatefacebook COMMAND [OPTION] [ARGS]...
Options:
--help Show this message and exit.
Commands:
config Add or list email and SMTP server configurations
page Add, remove or list pages to be scraped for events
run Run scraping utility with currently set configurations and pages
子命令
$ ihatefacebook config OPTION [ARGS]
Add or list email and SMTP server configurations
Options:
-a, --add key=value Add user.email, smtp.host, smtp.port configurations, with
the format key=val
-p, --password Set password for the user.email added using the -a option
-l, --list List currently set configurations
--help Show this message and exit.
$ ihatefacebook page OPTION [ARGS]
Add, remove or list pages to be scraped for events
Options:
-a, --add PAGE_ID Add a page to the list of pages to be scraped, using its
Facebook page ID
-r, --remove PAGE_ID Remove a page using its Facebook page ID
-l, --list List all pages from the list of pages to be scraped
--help Show this message and exit.
要求
pip安装所需的依赖项,但您也需要在计算机上安装这些依赖项:
- 谷歌浏览器
- ChromeDriver,确保它是与浏览器对应的版本,
把它定位在
/usr/local/bin/
。
注释
- 如果你在我更新代码之前注意到这一点, 请告诉我。
- 如果使用gmail作为smtp服务器,则需要打开less secure app access。
- 脚本使用launchd
在每次启动计算机时启动的macos上,
ihatefacebook
调用launchd
,并添加所需的配置 安装时。但是,您需要检查launchd
中脚本的状态,以确保它正常工作。这个 可以使用launchctl list | grep ihatefacebook
(或使用LaunchControl)完成, 0表示正常。检查~/Library/Logs/com.hot3eed.ihatefacebook/log.error
(或使用Console)进行调试。所有这些辛苦的体力劳动 可以在以后的更新中实现自动化。
待办事项
- 添加Linux支持。
- 添加Windows支持。