Re: [CGIv2] Instagram Photo Real Link Resolver

From chs_starterpacks_, 6 Years ago, written in Bash, viewed 755 times. This paste is a reply to [CGIv2] Instagram Photo Real Link Resolver from NAT - view diff
URL Embed
Download Paste or View Raw
  1. #!/bin/bash
  2. # A really simple CGI to resolve Instagram photo share link and show original photo.
  3. # Use fcgi_param to set env QUERY_STRING. You might use fcgi.conf from php5-fpm, it will works.
  4. # License under DO WHAT FUCK YOU WANT ( DWFYW )
  5. echo "Content-type: text/html";echo "";
  6. echo "<p>You can get original photo of Instagram posts by using this tool.</p>"
  7. echo "<p>Usage: Input Sahre URL(i.e. and click Get Photo."
  8. echo "<hr>"
  9. if [ ! -z $QUERY_STRING ]
  10. then
  11. QUERY_STRING=$(echo $QUERY_STRING | awk -F "%2Fp%2F" '{print $2}' | awk -F "&" '{print $1}' | awk -F "%2F" '{print $1}')
  12. echo -n "<img src=";curl --silent$QUERY_STRING | grep .jpg | awk '{print $3}' | awk -F "\"" '{print $2}';echo "></img>"
  13. fi
  14. echo "<form action='' method='get'>Share URL: <input name='url' type='text'></input><input name='submit' type='submit' value='Get Photo'></input></form>"

Reply to "Re: [CGIv2] Instagram Photo Real Link Resolver"

Here you can reply to the paste above