Skip to content

Run Daily Report mapherworld Hashtag #141

Run Daily Report mapherworld Hashtag

Run Daily Report mapherworld Hashtag #141

name: Run Daily Report mapherworld Hashtag
on:
schedule:
- cron: "0 4 * * *" # Run every day at 6 UTC
# push:
# branches:
# - master
jobs:
issue:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install Osmium
run: sudo apt-get install -y osmium-tool
- name: Install necessary dependecies
run: |
pip install flare-floss
pip install -e .
pip install tweepy
pip install -r requirements.txt
- name: Generate Daily Hashtag mapherworld Stats
run: |
osmsg --format csv image --tags 'building' 'highway' 'waterway' 'amenity' --name stats --all_tags --hashtags mapherworld --charts --summary --length highway --update --name stats/mapherworld/Daily/stats --force
- name: add stats to git
run: |
git pull
git config --global user.email "[email protected]"
git config --global user.name "kshitijrajsharma"
base_dir=stats/mapherworld/Daily
mkdir -p $base_dir
mv $base_dir/stats_summary.md $base_dir/Readme.md
git add -f $base_dir/*
git commit -m "Updated Daily mapherworld stats"
git push
- name : Tweet stats
env: #assign variables
API_KEY: ${{ secrets.API_KEY }}
API_KEY_SECRET: ${{ secrets.API_KEY_SECRET }}
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
ACCESS_TOKEN_SECRET: ${{ secrets.ACCESS_TOKEN_SECRET }}
BEARER_TOKEN: ${{ secrets.BEARER_TOKEN }}
run : |
commit_id=$(git rev-parse --short HEAD)
python tweet.py --git $commit_id --tweet '#mapherworld' --name stats/mapherworld/Daily/stats --mention '@openmapping_esa'