jasonflaherty
jasonflaherty

Reputation: 1944

Pull instagram photos and upload to my domain?

I would like to have a cronjob or the like run a script to pull my instagram photos to a folder on my domain. Has anyone done such a thing? Something like Instaport, but have it automated on my site?

I logged into the dev area on instagram and looked at some of the options, but get lost looking at the API. I haven't done much with an API.

Any thoughts or help would be appreciated.

Upvotes: 0

Views: 1274

Answers (1)

Ismailp
Ismailp

Reputation: 2383

Here is a quick and dirty solution I used once:

Fetch all your photos from Instagram using the API: There are some php classes out there you can use, for example: http://www.9lessons.info/2012/05/login-with-instagram-php.html

Grab the URL's of all your images

Make a script that stores these in a folder on your server. You can use something like this

$path_parts = pathinfo($url); // Return info about the URL
$image = ($path_parts['basename']); // Save file name in a variable
mkdir("folderName/", 0700); // Create the folder
copy($url,"folderName/".$image); // Copy files to folder

Hope this helps!

Upvotes: 1

Related Questions