Sorry if this was answered (I searched and found nothing). Let me know and I will remove it immediately.
I am writing a program that calls an API call that returns multiple lists of different lengths depending on the call (e.g. facebook API call). Enter the name of the person, and the list of images is returned, and in each picture there is a list that "loved" each photo. I want to save the list from the list of "likes").
import urllib.request
import urllib.parse
def id_list_generator(first,last):
pic_id_request = urllib.request.open('www.facebook.com/pics/id/term={first}+{last}[person]')
pic_id_list = pic_id_request.read()
for i in pic_id_list:
id_list.append(i)
return(id_list)
for i in id_list:
pic_list = urllib.request.open('www.facebook.com/pics/id/like/term={i}[likes]')
print pic_list
This will print multiple love lists for each image that the person has been tagged in:
foo, bar
bar, baz
baz, foo, qux
norf
I really don't know how to store them honestly.
I thought of using a list that would look like this after adding:
foo = [["foo", "bar"], ["bar","baz"],["baz","foo","qux"],["norf"]]
, . , , . , , .