[CGIv3] Instagram Photo Real Link Resolver

From Coreos, 7 Years ago, written in Bash, viewed 994 times. This paste is a reply to [CGIv2] Instagram Photo Real Link Resolver from NAT - view diff
URL https://code.nat.moe/view/32610de2 Embed
Download Paste or View Raw
  1. #!/bin/bash
  2. echo "Content-type: text/html";echo "";
  3. echo "<p>You can get original photo of Instagram posts by using this tool.</p>"
  4. echo "<p>Usage: Input Share URL of a post and click Get Photo.</p>"
  5. echo "<hr>"
  6. if [ ! -z $QUERY_STRING ]
  7. then
  8. QUERY_STRING=http://instagram.com/p/$(echo $QUERY_STRING | awk -F "%2Fp%2F" '{print $2}' | awk -F "&" '{print $1}' | awk -F "%2F" '{print $1}')
  9. echo -n "<p><b>Author: </b>";curl --silent $QUERY_STRING | grep og:description | awk '{print $3}' | awk -F "\"" '{print $2}' | awk -F "'" '{print $1}';echo "</p>"
  10. REAL_URL=$(curl --silent $QUERY_STRING | grep og:image | awk '{print $3}' | awk -F "\"" '{print $2}')
  11. echo -n "<p><b>Real URL: </b>$REAL_URL</p>"
  12. echo "<img src=$REAL_URL></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 "[CGIv3] Instagram Photo Real Link Resolver"

Here you can reply to the paste above

captcha