Re: [CGIv2] 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/) and click Get Photo."
echo "<hr>"
if [ ! -z $QUERY_STRING ]
then
QUERY_STRING=$(echo $QUERY_STRING | awk -F "%2Fp%2F" '{print $2}' | awk -F "&" '{print $1}' | awk -F "%2F" '{print $1}')
echo -n "<img src=";curl --silent http://instagram.com/p/$QUERY_STRING | grep .jpg | awk '{print $3}' | awk -F "\"" '{print $2}';echo "></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>"
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}