コード例 #1
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
from insta import Instagram
import os
import json
import pystache
import io
import webbrowser

numer = sys.argv[1]

#modify here
insta = Instagram('foousername', 'foopassword')

if insta.login() == False:
    print "Login failed"
    sys.exit(2)

temp = insta.getTotalUserFeed(numer)
followers = insta.getTotalFollowers(numer)
followings = insta.getTotalFollowings(numer)
followersnum = len(followers)
followingsnum = len(followings)

notfollowedback = []
for fr in followings:
    flag = True
    for fg in followers:
        if fg["pk"] == fr["pk"]:
コード例 #2
0
import sys
from insta import Instagram
import os
import json
import pystache
import io
import webbrowser
import random
from dotenv import load_dotenv

load_dotenv()
INSTAGRAM_ID = os.getenv("INSTAGRAM_ID")
USER = os.getenv("INSTAGRAM_USER")
PASSWORD = os.environ.get("INSTAGRAM_PASSWORD")

insta = Instagram(USER, PASSWORD)

print " ~ Connecting to Instagram"
if insta.login() == False:
    print "Login failed"
    sys.exit(2)
print " ~ Sending request to Instagram , fetching your feeds"
temp = insta.getTotalUserFeed(INSTAGRAM_ID)
likedUsers = {}
for item in temp:
    insta.getMediaLikers(item["id"])
    test = insta.LastJson["users"]
    for user in test:
        if user["username"] not in likedUsers:
            data = {}
            data["count"] = 1
コード例 #3
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys, os, json, pystache, io, random, requests
from insta import Instagram

#modify here
USERNAME = sys.argv[1]
insta = Instagram(USERNAME, sys.argv[2])
numer = sys.argv[3]
MAILGUN_API_KEY = sys.argv[4]
MAILGUN_DOMAIN = sys.argv[5]
MAILGUN_TO = sys.argv[6]

THIS_FOLDER = os.path.dirname(os.path.realpath(__file__))


def fullpath(file):
    return os.path.join(THIS_FOLDER, file)


FOLLOWERS_JSON_FILE = fullpath('followers_%s.json' % USERNAME)
FOLLOWINGS_JSON_FILE = fullpath('followings_%s.json' % USERNAME)

print " ~ Connecting to Instagram"
if insta.login() == False:
    print "Login failed"
    sys.exit(2)
print " ~ Sending request to Instagram , fetching your feeds"
temp = insta.getTotalUserFeed(numer)
likedUsers = {}
コード例 #4
0
import sys
from insta import Instagram
import os
import json
import pystache
import io

if len(sys.argv) < 3:
    print "Incorrect input args, use insta.py <username> <password>"
    sys.exit(1)

username = sys.argv[1]
password = sys.argv[2]

insta = Instagram(username, password)
if insta.login() == False:
    print "Login failed"
    sys.exit(2)

temp = insta.getTotalUserFeed(insta.username_id)
likedUsers = {}
for item in temp:
    insta.getMediaLikers(item["id"])
    test = insta.LastJson["users"]
    for user in test:
        if user["username"] not in likedUsers:
            data = {}
            data["count"] = 1
            data["name"] = user["full_name"]
            data["image"] = user["profile_pic_url"]
コード例 #5
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
from insta import Instagram
import os
import json
import pystache
import io
import webbrowser

numer = sys.argv[1]

#modify here
insta = Instagram('usernmefoo', 'passwordfoo')

if insta.login() == False:
    print "Login failed"
    sys.exit(2)

temp = insta.getTotalUserFeed(numer)
followers = insta.getTotalFollowers(numer)
followings = insta.getTotalFollowings(numer)
followersnum = len(followers)
followingsnum = len(followings)

notfollowedback = []
for fr in followings:
    flag = True
    for fg in followers:
        if fg["pk"] == fr["pk"]:
コード例 #6
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
from insta import Instagram
import os
import json
import pystache
import io
import webbrowser
import random

numer = sys.argv[1]
print " ~ Connecting to Instagram"
#modify here
insta = Instagram('usernamefoo', 'passfordfoo')

if insta.login() == False:
    print "Login failed"
    sys.exit(2)
print " ~ Sending request to Instagram , fetching your feeds"
temp = insta.getTotalUserFeed(numer)
likedUsers = {}
for item in temp:
    insta.getMediaLikers(item["id"])
    test = insta.LastJson["users"]
    for user in test:
        if user["username"] not in likedUsers:
            data = {}
            data["count"] = 1
            data["name"] = user["full_name"]