Wordlist-news #1258
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Wordlist-news | |
# Controls when the action will run. | |
on: | |
schedule: | |
- cron: "15 13 * * *" # At 13:25 UTC everyday. | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "wordlist" | |
wordlist: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
- name: Update & install xmllint | |
run: sudo apt update && sudo apt-get install libxml2-utils curl -y | |
- name: Run a one-line script FR | |
run: curl -s 'https://trends.google.com/trends/trendingsearches/daily/rss?geo=FR' | xmllint --xpath "//item/title" - | sed -e 's/<[^>]*>//g' >> news_FR | |
- name: Run a one-line script BE | |
run: curl -s 'https://trends.google.com/trends/trendingsearches/daily/rss?geo=BE' | xmllint --xpath "//item/title" - | sed -e 's/<[^>]*>//g' >> news_BE | |
- name: Run a one-line script CH | |
run: curl -s 'https://trends.google.com/trends/trendingsearches/daily/rss?geo=CH' | xmllint --xpath "//item/title" - | sed -e 's/<[^>]*>//g' >> news_CH | |
- name: Permutations options | |
run: | | |
cat news_FR news_BE news_CH | awk '{print tolower($0)}' > news_lower; | |
cat news_FR news_BE news_CH | awk '{print toupper($0)}' > news_upper; | |
sed "s/ //g" news_FR news_BE news_CH > news_nospaces; | |
sed "s/-//g" news_FR news_BE news_CH > news_nodash; | |
# TODO: fix it | |
# - name: Accent options | |
# run: iconv -f latin1 -t ascii//TRANSLIT news_FR news_CH news_BE news_nodash news_nospaces news_lower news_upper > news_noaccent | |
- name: Run sort and uniq | |
run: cat news* >> pourquoi; sort -u pourquoi > news; ls -la; wc -l news*; | |
# Runs a set of commands using the runners shell | |
- name: Git commit and push | |
run: | | |
git config user.name "News-bot" | |
git config user.email "" | |
git add news | |
git commit -m "[Bot] News from $(date +'%Y_%m_%d')" | |
git push origin master |