Skip to content

Bing img chatcher #1752

Bing img chatcher

Bing img chatcher #1752

Workflow file for this run

name: Bing img chatcher
on:
schedule:
- cron: 55 23 * * *
push:
jobs:
runer:
runs-on: [ubuntu-latest]
steps:
- name: Setup jq
run: |
sudo apt install jq
- name: checkout
uses: actions/checkout@v2.0.0
- name: body
env:
key: ${{ secrets.Actions_Key }}
ifttt_url: ${{ secrets.IFTTT_Webhook_URL }}
run: |
mkdir -p ~/.ssh/
echo "$key" | tr -d '\r' > ~/.ssh/id_rsa # Set private key
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
git config --global user.name 'Action Pusher'
git config --global user.email 'action@github.com'
get=`curl "https://bing.com/HPImageArchive.aspx?format=js&idx=0&n=1"|jq ".images[].url"`
prefix="https://bing.com"
getfix=`echo $get|sed "s#\"##g"`
echo $prefix$getfix
cd images
curl $prefix$getfix > `date +%Y-%m-%d`.png
curl $prefix$getfix > today.png
cd ..
git add .
git commit -m "Auto Commit"
git push origin master
curl -X POST -H "Content-Type: application/json" -d '{"value1":"Good!","value2":"Your picture is available.Address is","value3":"https://cdn.jsdelivr.net/gh/h5mcbox/bingimg@master/images/today.png"}' $ifttt_url