-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathinstapost.py
26 lines (23 loc) · 924 Bytes
/
instapost.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from justgood import imjustgood
media = imjustgood("YOUR_APIKEY_HERE")
post_url = "https://instagram.com/p/CJtqfEbhpjO/" # example instapost url
data = media.instapost(post_url)
# Get attributes
result = "Instagram Post"
result += "\nUsername : {}".format(data["result"]["username"])
result += "\nFullname : {}".format(data["result"]["fullname"])
result += "\nCreated : {}".format(data["result"]["created"])
result += "\nCaption : {}".format(data["result"]["caption"])
result += "\n\nPicture :\n{}".format(data["result"]["picture"])
number = 0
result += "\n\nMedia Post"
for a in data["result"]["postData"]:
number += 1
if a["type"] == "image":
result += "\n{}. Image Url : {}".format(number, a["postUrl"])
if a["type"] == "video":
result += "\n{}. Video Url : {}".format(number, a["postUrl"])
result += "\nPoster Url: {}".format(a["poster"])
print(result)
# Get JSON results
print(data)