GithubHelp home page GithubHelp logo

omarnagy91 / instagram-automation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dhohirpradana/instagram-automation

0.0 0.0 0.0 45.83 MB

[Python, Typescript] Instagram Automation Post Feed and Story, Integrate Data from Facebook Group and Page

License: MIT License

Python 50.02% TypeScript 49.98%

instagram-automation's Introduction

Instagram Automation Feed and Story

Automate post Instagram feed and Instagram story.

Steps

  1. Instagram account
key name description
IG_USERNAME Instagram username
IG_PASSWORD Instagram password
QUOTES_API_KEY API-Ninjas API key, you can get it from https://api-ninjas.com/api/quotes
  1. Use this template or Clone this repository and push to your Github https://github.com/dhohirpradana/Instagram-Automation.git

  2. Set Github Secrets Go to your repository -> Settings -> Secrets -> Action -> Set Your IG_USERNAME, IG_PASSWORD

  3. (if .github/workflows/main.yml not exists) Create Workflow Go to your repository -> Actions -> New workflow -> Setup a workflow yourself -> whatever.yaml Set when to run the script

name: Instagram Automation

# Controls when the workflow will run
on:
  # Triggers the workflow on push events but only for the master branch
  # push:
  #   branches: [ master ]
  
  # Triggers the workflow with scheduler
  schedule:
    - cron: '0 17 * * *'
    # - cron: '0 11 * * *'
    - cron: '0 05 * * *'

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# 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 "build"
  build:
    # 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:
      - uses: actions/checkout@v3
      # Python
      - name: Install Python
        uses: actions/setup-python@v4
        with:
          python-version: '3.10'

      - name: Install facebook-scrapper
        run: pip install git+https://github.com/kevinzg/facebook-scraper.git
        shell: bash

      - name: Run Python script
        env:
          COOKIES: '${{ secrets.COOKIES }}'
        id: get-posts
        run: |
          rm results.txt
          git config user.name [github_username]
          git config user.email [github_email]
          git fetch origin
          git reset --hard origin/master
          git pull
          python app.py
          git add results.txt
          git commit -m "results.txt changes"
          git push
        shell: bash

      # NodeJS
      - name: Use Node.js
        uses: actions/setup-node@v3
        with:
          node-version: '16.x'

      - name: Install ts-node
        run: npm install -g ts-node
          
      - name: Install dependencies
        run: npm install
        
      - name: Run node script
        env:
          IG_USERNAME: '${{ secrets.IG_USERNAME }}'
          IG_PASSWORD: '${{ secrets.IG_PASSWORD }}'
          # UNSPLASH_ACCESS_KEY: '${{ secrets.UNSPLASH_ACCESS_KEY }}'
          QUOTES_API_KEY: '${{ secrets.QUOTES_API_KEY }}'
        run: ts-node app.ts
  1. Save

Good Luck

alt text alt text

Instagram Automation CodeFactor

instagram-automation's People

Contributors

dhohirpradana avatar imgbotapp avatar dependabot[bot] avatar mend-bolt-for-github[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.