Anyone ever use Instagram API with Python? Please help me out then, thank you.

Status
This thread has been locked.

Badger

Software Developer
Supreme
Feedback score
22
Posts
2,366
Reactions
1,561
Resources
2
PHP:
from client import InstagramAPI

access_token = "YOUR_ACCESS_TOKEN"
client_secret = "YOUR_CLIENT_SECRET"
api = InstagramAPI(access_token=access_token, client_secret=client_secret)
r = True
while r == True:
    r = input("Keep running? (True or False)")
    medias = api.user_media_feed
    for media in medias:
        if api.user_followed_by(media.user.id):
            api.like_media(media.id)
    requests = api.user_incoming_requests
    for request in requests:
        if api.user_followed_by(request.user.id):
            api.approve_user_request(request.user.id)
I just basically need to know if this works. I'm trying to use the API that was made for python to mess with Instagram.
The API I'm using is: https://github.com/facebookarchive/python-instagram
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

ProfessionalDev

Feedback score
1
Posts
282
Reactions
111
Resources
0
PHP:
from client import InstagramAPI

access_token = "YOUR_ACCESS_TOKEN"
client_secret = "YOUR_CLIENT_SECRET"
api = InstagramAPI(access_token=access_token, client_secret=client_secret)
r = True
while r == True:
    r = input("Keep running? (True or False)")
    medias = api.user_media_feed
    for media in medias:
        if api.user_followed_by(media.user.id):
            api.like_media(media.id)
    requests = api.user_incoming_requests
    for request in requests:
        if api.user_followed_by(request.user.id):
            api.approve_user_request(request.user.id)
I just basically need to know if this works. I'm trying to use the API that was made for python to mess with Instagram.
The API I'm using is: https://github.com/facebookarchive/python-instagram
To be honest. I have no idea. I've never used python with Instagram:cry:
 

Wizard

Legendary Farting Unicorn
Premium
Feedback score
11
Posts
897
Reactions
478
Resources
0
I'm a super noob with coding, what u trying to make
Badger
 

omarhachach

Your Friendly Neighbourhood Snorlax
Supreme
Feedback score
14
Posts
627
Reactions
359
Resources
0
Funny story, it actually doesn't work. It's hella outdated... I decided to make my own API for it though! First time I'm ever doing this in Python :)

Code:
from urllib import urlopen
import json
class factory:
    def __init__(self, token, secret):
        self.user = "https://api.instagram.com/v1/users/self/?access_token=//-s-//".replace("//-s-//", token)
        self.user_id = "https://api.instagram.com/v1/users/{user-id}/?access_token=ACCESS-TOKEN".replace("ACCESS-TOKEN", token)
    def getUser(self):
        jsonCode = urlopen(self.user)
        res = json.load(jsonCode)
        print res['data']['username']
I was about to say, you should just make one yourself.

Well, I guess you can/should close the thread now.
 
Last edited:
Status
This thread has been locked.
Top