Use Gmail API to get Google Scholar alerts from Gmail for a certain date range (via http/https proxy), sort the articles according to the weights of the Alert author & Alert type & Artical journal, and combine them to a html file
Use GmailApi to get Google Scholar alerts from Gmail within a certain date range, combine and sort the alert publications according to the weights of alert authors, journals and alert types. Then, save them as one single html file.
Cache email ids and email contents as a pkl file to avoid frequent reading of GmailAPI.
缓存电子邮件id和电子邮件内容为pkl文件,避免频繁读取GmailAPI。
Analyze the publications in emails, create a list of alerts types and published journals based on email subjects and contents, and cache the lists into csv table files in /csv
Users modify the alerts author weights, alerts type weights and publication journal weights in the csv tables in /csv according to the authors and journals they care about. If no changes are made, the default weights are used.
Sort the publications according to the alerts author weights, alerts type weights and publication journal weights.
根据快讯作者权值、快讯类型权值和发表期刊权值,对文章进行排序。
Summarize the sorted publications into a single html file in /html folder.
将排序后的文章汇总成成单个html文件,保存在/html文件夹下。
Setting for first use / 初次使用
Follow the steps in Gmail API Client Library , rename the client_secret_XXXXXXXX_.json to
credentials.json and place it into the /json folder. When you firstly run the ScholarAlertGmail2html.py, you will get a token.joson in /json folder.
If you can't access the google api directly, you can use a proxy as a global proxy
importos# Use http proxy as a global proxyos.environ["http_proxy"] ="http://127.0.0.1:10809"os.environ["https_proxy"] ="http://127.0.0.1:10809"
change to your proxy setting and insert the code before the main function in quickstart.py
按照Gmail API Client Library 中的步骤,将client_secret_XXXXXX_.json重命名为credentials.json并放入/json文件夹。当你第一次运行ScholarAlertGmail2html.py时,你会在/json文件夹中得到token.joson。
Usage
Run ScholarAlertGmail2html.py using Python 3.
If you can't access the google api directly, you can use a proxy as a global proxy by remove the markers in the ScholarAlertGmail2html.py
importos# Use http proxy as a global proxyos.environ["http_proxy"] ="http://127.0.0.1:10809"os.environ["https_proxy"] ="http://127.0.0.1:10809"