Skip to content

Instantly share code, notes, and snippets.

View Kamleshpaul's full-sized avatar
🇮🇳

Kamlesh Paul Kamleshpaul

🇮🇳
View GitHub Profile
#zero downtime deployment nextjs without vercel
echo "Deploy starting..."
git pull
npm install || exit
BUILD_DIR=temp npm run build || exit
@Kamleshpaul
Kamleshpaul / instagram_scrape.php
Created September 25, 2019 15:41 — forked from cosmocatalano/instagram_scrape.php
Quick-and-dirty Instagram web scrape, just in case you don't think you should have to make your users log in to deliver them public photos.
<?php
//returns a big old hunk of JSON from a non-private IG account page.
function scrape_insta($username) {
$insta_source = file_get_contents('http://instagram.com/'.$username);
$shards = explode('window._sharedData = ', $insta_source);
$insta_json = explode(';</script>', $shards[1]);
$insta_array = json_decode($insta_json[0], TRUE);
return $insta_array;
}