A GitHub action that generates an RSS feed from a list of public Instagram accounts.
This action uses instagram-web-api. The action only requires authentication in the form of your Instagram username and can only fetch posts from public Instagram accounts.
If you see this error: TypeError: Cannot read property 'user' of undefined
. Either the Instagram account you entered is invalid or Instragram is ratelimiting your request. If the latter, try reducing your schedule to once or twice a day.
To create an Instagram RSS feed that updates once a day and automatically commits the feed to your repository:
- Make sure your GitHub repository has GitHub Pages enabled. Your feed URL will be whatever your domain is and then
instagram.json
(Example: https://katydecorah.com/instagram-rss-action/instagram.json). You can also change the feed filename using thefileName
option. - Create
.github/workflows/instram-rss.yml
file using the following template:
name: RSS
on:
schedule:
- cron: "0 17 * * *"
jobs:
generate_rss:
runs-on: macOS-latest
name: Generate RSS
steps:
- name: Checkout
uses: actions/checkout@v2
- name: RSS
id: rss
uses: katydecorah/[email protected]
with:
yourInstagram: YOUR_INSTAGRAM_HERE
listOfInstagrams: nytcooking,sohlae,swissmiss,soulfirefarm
- name: Commit files
if: ${{ success() && steps.rss.outputs.RSS_STATUS == 'success' }}
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A && git commit -m "Updated instagram.json"
git push "https://${GITHUB_ACTOR}:${{secrets.GITHUB_TOKEN}}@github.com/${GITHUB_REPOSITORY}.git" HEAD:${GITHUB_REF}
yourInstagram
: Required. Your Instagram username. This is required for authentication with the Instagram API.listOfInstagrams
: Required. Public Instagram usernames comma delimited.fileName
: The name of the JSON feed file name to be written. Default:instagram.json
.feedTitle
: The title of the RSS feed. This will appear as the title of the feed in your RSS reader. Default:Instagram
.pretty
: Remove hashtags and emoji from captions. Default:true
.