All Projects → pauloromeira → Onegram

pauloromeira / Onegram

Licence: mit
This repository is no longer maintained.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Onegram

Instagram Bot
An Instagram bot developed using the Selenium Framework
Stars: ✭ 138 (+0.73%)
Mutual labels:  instagram-api, bot, crawler, instagram
Instagram Scraper
scrapes medias, likes, followers, tags and all metadata. Inspired by instagram-php-scraper,bot
Stars: ✭ 2,209 (+1512.41%)
Mutual labels:  bot, crawler, scraper, instagram
Instagram Scraper
Scrapes an instagram user's photos and videos
Stars: ✭ 5,664 (+4034.31%)
Mutual labels:  instagram-api, scraper, instagram, instagram-client
Instagram4j
📷 Instagram private API in Java
Stars: ✭ 629 (+359.12%)
Mutual labels:  instagram-api, scraper, instagram, instagram-client
Instagramlive Php
A PHP script that allows for you to go live on Instagram with any streaming program that supports RTMP!
Stars: ✭ 362 (+164.23%)
Mutual labels:  instagram-api, instagram, instagram-client
Instagram Java Scraper
Instagram Java Scraper. Get account information, photos, videos and comments.
Stars: ✭ 335 (+144.53%)
Mutual labels:  instagram-api, instagram, instagram-client
Instagram api gem
A Ruby wrapper for the Instagram API
Stars: ✭ 100 (-27.01%)
Mutual labels:  instagram-api, instagram, instagram-client
Instapy Cli
✨ Python library and CLI to upload photo and video on Instagram. W/o a phone!
Stars: ✭ 498 (+263.5%)
Mutual labels:  instagram-api, instagram, instagram-client
Instagram Proxy Api
CORS compliant API to access Instagram's public data
Stars: ✭ 245 (+78.83%)
Mutual labels:  instagram-api, scraper, instagram
Instagram User Feed
This is a scrapper to easily fetch any feed and interact with Instagram (like, follow, etc.) without OAuth for PHP.
Stars: ✭ 435 (+217.52%)
Mutual labels:  instagram-api, instagram, instagram-client
Swiftinstagram
Instagram API client written in Swift
Stars: ✭ 570 (+316.06%)
Mutual labels:  instagram-api, instagram, instagram-client
Socialmanagertools Gui
🤖 👻 Desktop application for Instagram Bot, Twitter Bot and Facebook Bot
Stars: ✭ 293 (+113.87%)
Mutual labels:  bot, scraper, instagram
Instagram-Scraper-2021
Scrape Instagram content and stories anonymously, using a new technique based on the har file (No Token + No public API).
Stars: ✭ 57 (-58.39%)
Mutual labels:  instagram, scraper, instagram-api
Instagram Bot Dm
Instagram bot to send direct messages
Stars: ✭ 101 (-26.28%)
Mutual labels:  instagram-api, bot, instagram
InstagramCpp
Instagram REST API client wirtten in C++
Stars: ✭ 24 (-82.48%)
Mutual labels:  instagram-client, instagram, instagram-api
Scrapit
Scraping scripts for various websites.
Stars: ✭ 25 (-81.75%)
Mutual labels:  bot, crawler, scraper
Socialmanagertools Igbot
🤖 📷 Instagram Bot made with love and nodejs
Stars: ✭ 699 (+410.22%)
Mutual labels:  instagram-api, bot, instagram
Social Scraper
Tổng hợp script crawl dữ liệu từ các mạng xã hội & website tiếng Việt
Stars: ✭ 47 (-65.69%)
Mutual labels:  crawler, scraper, instagram
Instabotai
Instagram AI bot with face detection. It works without instagram api, need only login and password.
Stars: ✭ 181 (+32.12%)
Mutual labels:  instagram-api, bot, instagram
Instagram Php Scraper
Get account information, photos, videos, stories and comments.
Stars: ✭ 2,490 (+1717.52%)
Mutual labels:  instagram-api, instagram, instagram-client

onegram

pypi pyversions travis codecov requires gitter license
donate bitcoin

A simplistic api-like instagram bot powered by requests.

Warnings!

  • This isn't an official api. Use at your own risk.
  • Make sure you have the latest version installed. To update: pip install -U onegram.
  • Default rate limits are not configured properly, so adjust them to not get banned!

Installation

pip install onegram

Dependencies

Python 3.6

Examples

Follow someone

from onegram import follow

follow('<someone>')

Like all someone posts

from onegram import like, posts

for post in posts('<someone>'):
  like(post)

Who likes you most?

from collections import defaultdict
from operator import itemgetter

from onegram import posts, likes

rank = defaultdict(int)
for post in posts():
    for like_info in likes(post):
        username = like_info['username']
        rank[username] += 1

rank = sorted(rank.items(), key=itemgetter(1), reverse=True)

print(rank[:10]) # TOP 10!

Explicit login (optional)

from onegram import Login, posts

with Login(username='user', password='pass'):
  user_posts = list(posts())
  other_posts = list(posts('other'))
Also possible
from onegram import *

login()

last_post = next(posts())
post_likes = list(likes(last_post))

logout()

Cheatsheet

The set of functions are divided into queries and actions. For some queries the user is optional, with default set to the logged user.

Query Argument(s) Action Argument(s)
user_info [user] follow user
followers [user] unfollow user
following [user] like post
posts [user] unlike post
post_info post comment comment[, post]
likes post uncomment comment[, post]
comments post save post
feed unsave post
explore [tag]

Rate Limits

Settings can be overridden if you use one of the explicit login forms (defaults: onegram/settings.py). It's possible to define a fixed User-Agent, for example. Overall, the most userful setting is RATE_LIMITS, where you can set rate limits for:

  1. Each query or action
  2. All queries or all actions
  3. All queries and actions

Example

from onegram import login

minute = 60
hour = minute * 60
day = hour * 24

rate_limits = {
  'queries': [(1, 1)], # One query per second
  'actions': [(1, 3)], # One action per 3 seconds
  'like': [
    (5, minute), # A maximum of 5 likes in a minute
    (100, day)   # A maximum of 100 likes in a day
  ],
  'comment': [(1, 5)], # One comment per 5 seconds
}
# You can use '*' to set limits for all queries and actions.

settings = {
  'RATE_LIMITS': rate_limits,
  'RATE_PERSIST_ENABLED': True, # enabled by default
  'RATE_PERSIST_DIR': '.onegram/rates' # default directory
}

login(custom_settings=settings)
# ...

Notice that you can specify a greedy or patient behaviour, or both. This is possible because you can have different rates for different time intervals.

For example, both (10, 10) and (1, 1) will do 10 requests in 10 seconds, but the first one is greedy. It will make 10 requests and wait 10 seconds to continue, whereas the second one will make one request at each second.

As general rule:

Greedy = (times, seconds)
Patient = (1, seconds/times)

Tips

  • Export your credentials so you don't have to type it:
    export INSTA_USERNAME=username
    export INSTA_PASSWORD=password
    
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].