Skip to content

automated blog page

  • provides various auto generated daily news
  • weather
  • google search for freebsd calendar
  • joke of the day

navigation

daily:
  stage: build
  tags:
    - eatthebar
  only:
    - schedules
  script:
    - cd content
    - touch "$(date +%F).md"
    - touch "$(date +%F).md"
    - echo "# $(date +%F)" >> "$(date +%F).md"
    - echo "it is day $(date +%j) of 365 " >> "$(date +%F).md"
    - echo " " >> "$(date +%F).md"
    - echo "it is week  $(date +%V) of 54" >> "$(date +%F).md"
    - jk=$(wget -q https://icanhazdadjoke.com -q -O - |
      grep -o  '<p class="subtitle">.*</p>' |
      sed 's/<p class="subtitle">//g' |
      sed 's/<\/p>//g') 
    - echo " " >> "$(date +%F).md"
    - echo "## dad joke of the day" >> "$(date +%F).md"
    - echo " " >> "$(date +%F).md"
    - echo "$jk" >> "$(date +%F).md"
    - echo " " >> $(date +%F).md 
    - echo " " >> $(date +%F).md 
    - echo "## linux calendar history for today" >> "$(date +%F).md"
    - echo " " >> $(date +%F).md 
    - all=$(calendar -A 0 | cut -d ' ' -f3- | sed s"/[:=<>'., ]/+/g" | tr "++" "+")
    - url="https://www.google.com/search?q="
    - while read -r line; do echo "[$line]($url$line)" >> "$(date +%F).md"; echo ' ' >> "$(date +%F).md"; done <<< "$all"
    - echo "## weather" >> "$(date +%F).md"
    - echo "![]($(date +%F)-weather.png)" >> "$(date +%F).md"
    - echo " " >> "$(date +%F).md"
    - curl v2.wttr.in/Seattle_1.png -o "$(date +%F)"-weather.png
      #- pandoc -f markdown -t html "$(date +%F).md" -o "$(date +%F)".html
    - cat mdl1.html > "$(date +%F)".html
    - pandoc -f markdown -t html "$(date +%F).md" -o daily.html
    - cat daily.html >> "$(date +%F)".html
    - cat mdl2.html >> "$(date +%F)".html
    - cat "$(date +%F).md"
    - ls
    - docker cp "$(date +%F).html" eatthebar:/usr/share/nginx/html/2022/
    - docker cp "$(date +%F)-weather.png" eatthebar:/usr/share/nginx/html/2022/
  artifacts:
    paths:
      - content