Skip to content

Dominic789654/scholar_tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

532 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Scholar Citation Tracker

Update Citations

A Python-based tool that automatically tracks and records citation statistics from Google Scholar. It generates daily reports of citation counts, h-index, and individual paper statistics in a clean markdown format.

Features

  • πŸ€– Automated daily tracking of Google Scholar citations
  • πŸ“Š Tracks overall citation count and h-index
  • πŸ“ Individual paper citation statistics
  • πŸ“ˆ Historical citation data tracking
  • πŸ“‘ Clean markdown report generation
  • βš™οΈ Easy configuration with Google Scholar ID
  • πŸ”„ GitHub Actions integration for automatic updates

Setup

Prerequisites

  • Python 3.x
  • Git

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/scholar-citation-tracker.git
    cd scholar-citation-tracker
  2. Install required packages:

    pip install -r requirements.txt
  3. Configure your Google Scholar Profile:

    The most reliable way to track your profile is by using your Google Scholar ID.

    How to find your Google Scholar ID:

    1. Go to your Google Scholar profile page.
    2. Look at the URL in your browser's address bar.
    3. The URL will look something like this: https://scholar.google.com/citations?user=VtK5lwUAAAAJ&hl=en
    4. Your Scholar ID is the string of characters after user=. In the example above, it's VtK5lwUAAAAJ.

    Update the configuration:

    • Open the config.json file.
    • Replace "YOUR_SCHOLAR_ID_HERE" with your actual Google Scholar ID:
    {
      "author_id": "VtK5lwUAAAAJ",
      "author_query": null
    }

    Alternatively, you can track by name, but this is less reliable:

    {
      "author_id": null,
      "author_query": "Your Name Institution"
    }

Local Usage

Run the tracker manually from your terminal:

python run.py

The script will:

  1. Fetch your latest Google Scholar statistics using the configured ID.
  2. Update the citation history in data/citation_history.json.
  3. Generate an updated markdown report in data/citations.md.
  4. Create trend charts and a dashboard in the data/ directory.

Automated Tracking with GitHub Actions

This project can be automated to run daily using GitHub Actions.

  1. Fork this repository.
  2. Enable GitHub Actions in your fork:
    • Go to your repository's "Settings" > "Actions" > "General".
    • Under "Workflow permissions," select "Read and write permissions."
  3. The tracker will automatically run daily at 01:00 UTC. You can change the schedule in .github/workflows/update_citations.yml.

Project Structure

scholar_tracker/
β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       └── update_citations.yml  # GitHub Actions configuration
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ citation_history.json # Historical citation data
β”‚   β”œβ”€β”€ citations.md          # Generated markdown report
β”‚   β”œβ”€β”€ dashboard.html        # Interactive citation dashboard
β”‚   β”œβ”€β”€ citation_trends.png   # Trend chart for citations
β”‚   β”œβ”€β”€ paper_trends.png      # Trend chart for top papers
β”‚   └── tracker.log           # Log file for debugging
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ scholar_tracker.py    # Core tracking functionality
β”‚   β”œβ”€β”€ markdown_writer.py    # Markdown report generator
β”‚   └── chart_generator.py    # Chart generation logic
β”œβ”€β”€ config.json               # Configuration file
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ run.py                    # Main execution script
└── README.md

Output Example

The generated data/citations.md includes:

  • Overall citation statistics (Total Citations, H-index)
  • A summary of new citations since the last update.
  • Per-paper citation counts.
  • Historical data trends.
# Citation Statistics

**Last updated:** 2024-07-21

## Overall Statistics
- **Total Citations:** 1234 (+10)
- **H-index:** 25

## New Citations Today
- **Paper Title A:** 5 new citations (100 -> 105)
- **Paper Title B:** 5 new citations (50 -> 55)

## Top Papers by Citation
| Paper                 | Citations | Year |
|-----------------------|-----------|------|
| My Awesome Paper 1    | 105       | 2023 |
| Another Great Paper   | 55        | 2022 |
...

Customization

Report Format

To change the content or layout of the markdown report, edit src/markdown_writer.py.

Update Frequency

Modify the cron schedule in .github/workflows/update_citations.yml to change how often the tracker runs.

Troubleshooting

Common Issues

  1. Rate Limiting: Google Scholar may temporarily block requests if updated too frequently. The default daily schedule is usually safe. If you encounter errors, check data/tracker.log for details.
  2. GitHub Actions Failures:
    • Permissions: Ensure "Read and write permissions" are enabled for Actions in your repository settings. This allows the workflow to commit the updated data files.
    • Workflow Not Running: Check that the .github/workflows/update_citations.yml file exists on your main branch. Scheduled actions only run on the default branch.

Contributing

Contributions are welcome! Please feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License.

Acknowledgments

  • scholarly for providing a great interface to Google Scholar.
  • GitHub Actions for the powerful automation.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors