I would like you to create a class for collecting instagram photos by username or by hashtag.
The idea is next. Let's say - you create a class InstagramAPI. then with this class you call a method:
.getPhotos(keyword, amount, last_photoid, new = true)
So if the keyword is "@pavelk2" - then you need to find the last photos of a user with a name "pavelk2". If your keyword is "#unitn" - then you need to retrieve the last photos with a hashtag "unitn". The amount - is clear - amount of photos to retrieve. The last_photoid - (if is defined) - tells from which photo to start retrieving. New - can be true or false. If it is true - it will retrieve the newest photos starting from last_photoid (or just simply newest - if this value is not defined). If new is false, then it will show the older photos made before last_photoid.
You do not need to write everything from scratch - there are plenty of existing python libraries for working with instagram - you can easily use and just wrap them in something usable for solving our task.
Please create 2 files - one with the class and another one - which imports this class, defines all the necessary settings data (such as client_id for the instagram application) and runs the getPhotos method, which returns a list of photos. Then doing
for photo in photos:
print photo
you show the data about each photo.
I would like you to create a class for collecting instagram photos by username or by hashtag.
The idea is next. Let's say - you create a class InstagramAPI. then with this class you call a method:
.getPhotos(keyword, amount, last_photoid, new = true)
So if the keyword is "@pavelk2" - then you need to find the last photos of a user with a name "pavelk2". If your keyword is "#unitn" - then you need to retrieve the last photos with a hashtag "unitn". The amount - is clear - amount of photos to retrieve. The last_photoid - (if is defined) - tells from which photo to start retrieving. New - can be true or false. If it is true - it will retrieve the newest photos starting from last_photoid (or just simply newest - if this value is not defined). If new is false, then it will show the older photos made before last_photoid.
You do not need to write everything from scratch - there are plenty of existing python libraries for working with instagram - you can easily use and just wrap them in something usable for solving our task.
Please create 2 files - one with the class and another one - which imports this class, defines all the necessary settings data (such as client_id for the instagram application) and runs the getPhotos method, which returns a list of photos. Then doing
for photo in photos:
print photo
you show the data about each photo.