Skip to content

Parse unread emails from Google Scholar alerts and sort publication by relevance

License

Notifications You must be signed in to change notification settings

AI4Code-HUST/scholar_alters

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

443 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scholar Alters

Parse unread emails from Google Scholar alerts and update README.md.

Setting for First Use

  1. Enable Gmail API and Download Credentials

    1. Go to Google Cloud Console

    2. Create a new project (or select an existing one).

    3. Navigate to APIs & Services → Library, search for Gmail API, and enable it.

    4. Go to APIs & Services → Credentials → Create Credentials → OAuth Client ID.

      • Application type: Desktop app.

      • Download the generated credentials.json file and place it in the project root.

    Example structure:

    .
    ├── credentials.json
    

    Example credentials.json:

    {
         "installed": {
              "client_id": "YOUR_CLIENT_ID",
              "project_id": "YOUR_PROJECT_ID",
              "auth_uri": "https://accounts.google.com/o/oauth2/auth",
              "token_uri": "https://oauth2.googleapis.com/token",
              "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
              "client_secret": "YOUR_CLIENT_SECRET",
              "redirect_uris": [
                    "http://localhost"
              ]
         }
    }
  2. Configure OAuth Consent Screen (In Production)

    1. In Google Cloud Console, go to APIs & Services → OAuth consent screen.
    2. Choose External as the user type.
    3. Fill in all required fields: App name, User support email, Authorized domains, Developer contact info.\
    4. In the Scopes section, add: https://mail.google.com/, https://www.googleapis.com/auth/gmail.readonly
    5. Skip the Test users section.
    6. In the Publishing status section, click Publish App
  3. Run script.sh:

    bash script.sh
    

    For the first run, you will need to log in to your Google account. Ensure that your Gmail account is added as a test user for your app. Refer to this Stack Overflow post for guidance.

    This will create a ./data/token.json file.

  4. Copy the information from token.json into a GitHub Action secret variable named TOKEN_CONFIG_JSON.

    Example token.json:

    {
         "token": "YOUR_ACCESS_TOKEN",
         "refresh_token": "YOUR_REFRESH_TOKEN",
         "token_uri": "https://oauth2.googleapis.com/token",
         "client_id": "YOUR_CLIENT_ID",
         "client_secret": "YOUR_CLIENT_SECRET",
         "scopes": [
              "https://mail.google.com/",
              "https://www.googleapis.com/auth/gmail.readonly"
         ],
         "universe_domain": "googleapis.com",
         "account": "",
         "expiry": "YOUR_EXPIRY_DATE"
    }

Run

Run the following command from your CLI:

bash script.sh

About

Parse unread emails from Google Scholar alerts and sort publication by relevance

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.9%
  • Shell 0.1%