{"id":40504165,"url":"https://github.com/ambicuity/green-contributions","last_synced_at":"2026-01-20T19:13:23.114Z","repository":{"id":298038873,"uuid":"998652196","full_name":"ambicuity/green-contributions","owner":"ambicuity","description":"Automates daily Git commits with weather reports to keep your GitHub contribution graph green.","archived":false,"fork":false,"pushed_at":"2025-07-24T19:35:34.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-25T00:45:00.987Z","etag":null,"topics":["automation","cron","github-contributions","python","script","weather-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ambicuity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-09T03:12:52.000Z","updated_at":"2025-07-24T19:35:38.000Z","dependencies_parsed_at":"2025-07-24T21:16:41.673Z","dependency_job_id":"f76e9a5f-b7bb-4f1b-b44a-4a4c588b0864","html_url":"https://github.com/ambicuity/green-contributions","commit_stats":null,"previous_names":["ambicuity/green-contributions"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ambicuity/green-contributions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ambicuity%2Fgreen-contributions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ambicuity%2Fgreen-contributions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ambicuity%2Fgreen-contributions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ambicuity%2Fgreen-contributions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ambicuity","download_url":"https://codeload.github.com/ambicuity/green-contributions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ambicuity%2Fgreen-contributions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28609908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T18:56:40.769Z","status":"ssl_error","status_checked_at":"2026-01-20T18:54:26.653Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","cron","github-contributions","python","script","weather-api"],"created_at":"2026-01-20T19:13:22.982Z","updated_at":"2026-01-20T19:13:23.070Z","avatar_url":"https://github.com/ambicuity.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🟩 Green Contributions Automator (Weather Edition)\n\nThis repository hosts a simple automation script designed to maintain a consistent daily contribution streak on GitHub. More than just keeping the contribution graph green, this project incorporates a \"fun\" element by dynamically fetching and committing **daily weather reports**.\n\n## 🌟 Purpose\n\nThe primary goals of this project are:\n* To demonstrate and practice setting up `cron` jobs on a Linux server.\n* To automate Git commit and push operations.\n* To playfully \"green up\" the GitHub contribution graph.\n* To build a cumulative log of **daily weather information** over time.\n\n## ✨ How it Works\n\nThe core of this project is a shell script (`run_weather_automation.sh`) that runs on a remote server via a `cron` job.\n\n1.  **Daily Execution**: A `cron` job is scheduled to run the `run_weather_automation.sh` script twice every day (at midnight and noon server time).\n2.  **Content Generation**: The script executes a Python script (`weather_report.py`) that uses a weather API (e.g., OpenWeatherMap) to fetch current weather conditions for a specified location (e.g., Boston, US).\n3.  **File Update**: The fetched weather data, along with a timestamp, is appended to `daily_weather_report.md`.\n4.  **Git Operations**:\n    * The `daily_weather_report.md` file (and potentially `weather_script_log`) is added to the Git staging area.\n    * A new commit is created with a descriptive message (including an emoji!).\n    * The changes are pushed to this GitHub repository (`master` branch).\n5.  **Logging**: All output from the cron job (including script messages and errors) is redirected to `cron_weather.log` for easy monitoring and debugging. A separate `weather_script_log` also tracks successful generation.\n\n## 🚀 Setup \u0026 Installation (for your own Namecheap server)\n\nIf you'd like to set up a similar automation on a Namecheap shared hosting server, here's a high-level overview of the steps we followed:\n\n1.  **Clone this repository** on your server via SSH:\n    ```bash\n    git clone [https://github.com/ambicuity/green-contributions.git](https://github.com/ambicuity/green-contributions.git)\n    cd green-contributions\n    ```\n2.  **Configure Git Identity (Crucial for GitHub Contributions):**\n    Ensure the email used here is **added and VERIFIED** on your GitHub account, otherwise contributions won't show on your profile graph.\n    ```bash\n    git config --global user.email \"your_github_verified_email@example.com\"\n    git config --global user.name \"Your Name\"\n    ```\n3.  **Set up Python Environment (via cPanel):**\n    * Log in to **cPanel**.\n    * Go to **\"Setup Python App\"**.\n    * Click \"CREATE APPLICATION\".\n    * Select your **Python version** (e.g., Python 3.9).\n    * Set **Application Root** to `/home/YOUR_CPANEL_USERNAME/green-contributions`.\n    * Click \"CREATE\".\n    * Once created, note the \"Enter to virtual environment\" command (e.g., `source /home/YOUR_CPANEL_USERNAME/virtualenv/green-contributions/3.6/bin/activate`). This is your virtual environment path.\n4.  **Install Python Dependencies:**\n    * SSH into your server.\n    * Navigate to your project: `cd /home/YOUR_CPANEL_USERNAME/green-contributions`\n    * Activate the Namecheap-provided virtual environment (using the path from step 3):\n        ```bash\n        source /home/YOUR_CPANEL_USERNAME/virtualenv/green-contributions/3.6/bin/activate\n        ```\n    * Install required libraries:\n        ```bash\n        pip install -r requirements.txt\n        ```\n5.  **Configure `weather_report.py`:**\n    * Open `weather_report.py` and replace placeholder API keys, `CITY`, and `COUNTRY_CODE` with your desired values.\n6.  **Update `run_weather_automation.sh`:**\n    * Open `run_weather_automation.sh` (e.g., `nano run_weather_automation.sh`).\n    * Ensure the `source` command at the beginning uses the **exact virtual environment path** noted in step 3.\n    * Make the script executable: `chmod +x run_weather_automation.sh`\n7.  **Set up the Cron Job (via cPanel):**\n    * Go to cPanel's **\"Cron Jobs\"** section.\n    * Set the schedule (e.g., \"Twice Per Day\" or `0 0,12 * * *`).\n    * For the **Command**, use:\n        ```bash\n        /bin/bash -c \"cd /home/YOUR_CPANEL_USERNAME/green-contributions \u0026\u0026 source /home/YOUR_CPANEL_USERNAME/virtualenv/green-contributions/3.6/bin/activate \u0026\u0026 ./run_weather_automation.sh \u003e\u003e /home/YOUR_CPANEL_USERNAME/green-contributions/cron_weather.log 2\u003e\u00261\"\n        ```\n        Remember to replace `YOUR_CPANEL_USERNAME` with your actual cPanel username.\n\n## 📜 Daily Weather Report Log\n\nCheck `daily_weather_report.md` in this repository to see the accumulating collection of daily weather information!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fambicuity%2Fgreen-contributions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fambicuity%2Fgreen-contributions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fambicuity%2Fgreen-contributions/lists"}