Exemple #1
0
from context import Instagram # pylint: disable=no-name-in-module
from time import sleep

instagram = Instagram()
instagram.with_credentials('username', 'password', 'pathtocache')
instagram.login()

sleep(2) # Delay to mimic user

username = '******'
following = []
account = instagram.get_account(username)
sleep(1)
following = instagram.get_following(account.identifier, 150, 100, delayed=True) 
for following_user in following['accounts']:
    print(following_user)
Exemple #2
0
from context import Instagram # pylint: disable=no-name-in-module

instagram = Instagram()
me = instagram.get_account('ashvardanian')
print(me)
for media in instagram.yield_pagintated_data_w_errors(instagram.get_user_medias_page, user_id=me.identifier):
    print(media)
Exemple #3
0
medias = instagram.get_medias("balleralert", 25)
media = medias[6]

print(media)
account = media.owner
print(account)
account2=instagram.get_account_by_id(account.identifier)
print(account2)

#get following
print("following")
sleep(2) # Delay to mimic user

username = '******'
following = []
account = instagram.get_account(username)
sleep(1)
following = instagram.get_following(account.identifier, 10, 10, delayed=True)
for following_user in following['accounts']:
    print(following_user)

#get folleers
print("followers")

sleep(2) # Delay to mimic user

username = '******'
followers = []
account = instagram.get_account(username)
sleep(1)
followers = instagram.get_followers(account.identifier, 10, 10, delayed=True)
from context import Instagram # pylint: disable=no-name-in-module

# If account is public you can query Instagram without auth
instagram = Instagram()

# For getting information about account you don't need to auth:
account = instagram.get_account('fernandodenitto')

# Available fields
print('Account info:')
print('Id', account.identifier)
print('Username', account.username)
print('Full name', account.full_name)
print('Biography', account.biography)
print('Profile pic url', account.get_profile_picture_url())
print('External Url', account.external_url)
print('Number of published posts', account.media_count)
print('Number of followers', account.followed_by_count)
print('Number of follows', account.follows_count)
print('Is private', account.is_private)
print('Is verified', account.is_verified)
print('Medias', account.medias)
from context import Instagram  # pylint: disable=no-name-in-module

# If account is public you can query Instagram without auth
instagram = Instagram()

# For getting information about account you don't need to auth:
account = instagram.get_account('kevin')

# Available fields
print('Account info:')
print('Id', account.identifier)
print('Username', account.username)
print('Full name', account.full_name)
print('Biography', account.biography)
print('Profile pic url', account.get_profile_picture_url())
print('External Url', account.external_url)
print('Number of published posts', account.media_count)
print('Number of followers', account.followed_by_count)
print('Number of follows', account.follows_count)
print('Is private', account.is_private)
print('Is verified', account.is_verified)
Exemple #6
0
from context import Instagram  # pylint: disable=no-name-in-module
import json
import re
# If account is public you can query Instagram without auth
instagram = Instagram()

# For getting information about account you don't need to auth:

f = open('c.txt', "r")
lines = f.readlines()

print(lines)
output = []
for line in lines:
    print(line)
    account = instagram.get_account(line.replace('\n', ''))
    reg = re.compile("(\d{2}\d{5}\d{4})")

    data = {
        "id": account.identifier,
        "username": account.username,
        "follower_count": account.followed_by_count,
        "biography": account.biography,
        "full_name": account.full_name
    }

    # print(data)

    # location = instagram.get_location_by_id(account.identifier)
    # print(location)