[CGIv3] Instagram Photo Real Link Resolver

From Coreos, 7 Years ago, written in Bash, viewed 1'069 times. This paste is a reply to [CGIv2] Instagram Photo Real Link Resolver from NAT - go back
URL https://code.nat.moe/view/32610de2/diff Embed
Viewing differences between [CGIv2] Instagram Photo Real Link Resolver and [CGIv3] Instagram Photo Real Link Resolver
#!/bin/bash
# A really simple CGI to resolve Instagram photo share link and show original photo.
# Use fcgi_param to set env QUERY_STRING. You might use fcgi.conf from php5-fpm, it will works.
# License under DO WHAT FUCK YOU WANT ( DWFYW )
echo "Content-type: text/html";echo "";
echo "<p>You can get original photo of Instagram posts by using this tool.</p>"
echo "<p>Usage: Input Sahre URL(i.e. http://instagram.com/p/rtTL1VQVZt/) Share URL of a post and click Get Photo."
</p>"
echo "<hr>"
if [ ! -z $QUERY_STRING ]
then
QUERY_STRING=$(echo QUERY_STRING=http://instagram.com/p/$(echo $QUERY_STRING | awk -F "%2Fp%2F" '{print $2}' | awk -F "&" '{print $1}' | awk -F "%2F" '{print $1}')
echo -n "<img src=";curl "<p><b>Author: </b>";curl --silent http://instagram.com/p/$QUERY_STRING $QUERY_STRING grep .jpg grep og:description | awk '{print $3}' | awk -F "\"" '{print $2}';echo "></img>"
$2}' | awk -F "'" '{print $1}';echo "</p>"
REAL_URL=$(curl --silent $QUERY_STRING | grep og:image | awk '{print $3}' | awk -F "\"" '{print $2}')
echo -n "<p><b>Real URL: </b>$REAL_URL</p>"
echo "<img src=$REAL_URL></img>"
fi
echo "<form action='' method='get'>Share URL: <input name='url' type='text'></input><input name='submit' type='submit' value='Get Photo'></input></form>"
Photo'></input></form>"

Reply to "[CGIv3] Instagram Photo Real Link Resolver"

Here you can reply to the paste above

captcha