Permalink
Browse files

Initial commit

  • Loading branch information...
James Whelton
James Whelton committed Apr 10, 2012
0 parents commit 284a70d84b3525d6d2c1e601025b5d3799d166fd
@@ -0,0 +1,43 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>Page Not Found :(</title>
+ <style>
+ ::-moz-selection { background: #fe57a1; color: #fff; text-shadow: none; }
+ ::selection { background: #fe57a1; color: #fff; text-shadow: none; }
+ html { padding: 30px 10px; font-size: 20px; line-height: 1.4; color: #737373; background: #f0f0f0; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
+ html, input { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
+ body { max-width: 500px; _width: 500px; padding: 30px 20px 50px; border: 1px solid #b3b3b3; border-radius: 4px; margin: 0 auto; box-shadow: 0 1px 10px #a7a7a7, inset 0 1px 0 #fff; background: #fcfcfc; }
+ h1 { margin: 0 10px; font-size: 50px; text-align: center; }
+ h1 span { color: #bbb; }
+ h3 { margin: 1.5em 0 0.5em; }
+ p { margin: 1em 0; }
+ ul { padding: 0 0 0 40px; margin: 1em 0; }
+ .container { max-width: 380px; _width: 380px; margin: 0 auto; }
+ /* google search */
+ #goog-fixurl ul { list-style: none; padding: 0; margin: 0; }
+ #goog-fixurl form { margin: 0; }
+ #goog-wm-qt, #goog-wm-sb { border: 1px solid #bbb; font-size: 16px; line-height: normal; vertical-align: top; color: #444; border-radius: 2px; }
+ #goog-wm-qt { width: 220px; height: 20px; padding: 5px; margin: 5px 10px 0 0; box-shadow: inset 0 1px 1px #ccc; }
+ #goog-wm-sb { display: inline-block; height: 32px; padding: 0 10px; margin: 5px 0 0; white-space: nowrap; cursor: pointer; background-color: #f5f5f5; background-image: -webkit-linear-gradient(rgba(255,255,255,0), #f1f1f1); background-image: -moz-linear-gradient(rgba(255,255,255,0), #f1f1f1); background-image: -ms-linear-gradient(rgba(255,255,255,0), #f1f1f1); background-image: -o-linear-gradient(rgba(255,255,255,0), #f1f1f1); -webkit-appearance: none; -moz-appearance: none; appearance: none; *overflow: visible; *display: inline; *zoom: 1; }
+ #goog-wm-sb:hover, #goog-wm-sb:focus { border-color: #aaa; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); background-color: #f8f8f8; }
+ #goog-wm-qt:focus, #goog-wm-sb:focus { border-color: #105cb6; outline: 0; color: #222; }
+ input::-moz-focus-inner { padding: 0; border: 0; }
+ </style>
+</head>
+<body>
+ <div class="container">
+ <h1>Not found <span>:(</span></h1>
+ <p>Sorry, but the page you were trying to view does not exist.</p>
+ <p>It looks like this was the result of either:</p>
+ <ul>
+ <li>a mistyped address</li>
+ <li>an out-of-date link</li>
+ </ul>
+ <script>
+ var GOOG_FIXURL_LANG = (navigator.language || '').slice(0,2),GOOG_FIXURL_SITE = location.host;
+ </script>
+ <script src="http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"></script>
+ </div>
+
@@ -0,0 +1,178 @@
+<?
+ //API Client details
+ //Create a client or view client details or register as a developer here: http://instagram.com/developer/manage/
+ $client_details = array(
+ 'grant_type' => 'authorization_code',
+ 'client_id' => 'client_id',
+ 'client_secret' => 'client_secret',
+ 'redirect_uri' => 'redirect_uri',
+ 'code' => $_GET['code']
+ );
+
+
+ //request access token via Curl
+ $ch = curl_init();
+ curl_setopt($ch, CURLOPT_URL, "https://api.instagram.com/oauth/access_token");
+ curl_setopt($ch, CURLOPT_POST, count($client_details));
+ curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($client_details));
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json'));
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+
+ $response = curl_exec($ch);
+ curl_close($ch);
+
+ //create user object
+ $user = json_decode($response);
+?>
+
+<!doctype html>
+<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
+<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
+<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
+<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
+<head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <title>GramGrab - Instagram viewing and downloading tool</title>
+ <meta name="description" content="Easily view and download all your Instgrams pics in a kick ass fashion!">
+
+ <meta name="viewport" content="width=device-width">
+ <link rel="stylesheet" href="css/style.css">
+ <style>
+ #loading {
+ z-index:999;
+ width:100%;
+ height:100%;
+ position: fixed;
+ top: 0px;
+ left: 0px;
+ color: #fff;
+ text-align:center;
+ font: 80px 'Lobster13Regular', Arial, sans-serif;
+ }
+
+ .loading-dim{
+ z-index:998;
+ width:100%;
+ height:100%;
+ position: fixed;
+ top: 0px;
+ left: 0px;
+ background-color: #000;
+ opacity: 0.5;
+ -moz-opacity: 0.5;
+ filter:alpha(opacity=5);
+ text-shadow: #000 0px 0px 10px;
+ }
+
+ .loader_pic{
+ margin-top:50px;
+ margin-bottom:30px;
+ box-shadow: #000 0px 0px 10px;
+ }
+ </style>
+ <script src="js/libs/modernizr-2.5.3.min.js"></script>
+</head>
+<body>
+ <!--[if lt IE 7]><p class=chromeframe>Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</p><![endif]-->
+ <div class="loading-dim"></div>
+ <div id="loading">
+ <img src="<?=str_replace("\\", "", $user->user->profile_picture);?>" class="loader_pic" />
+ <br />Hold on <?=$user->user->full_name;?>,
+ <br />I'm loading your Instagrams
+ <br /><img src="img/loader.gif" />
+ </div>
+
+ <a href="http://github.com/jwhelton/gramgrab"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://a248.e.akamai.net/assets.github.com/img/e6bef7a091f5f3138b8cd40bc3e114258dd68ddf/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub"></a>
+
+ <header>
+ <div id="inner">
+ <div id="instruct"></div>
+ <a href="http://gramgrab.com" class="logo"><img src="img/logo.png" /></a>
+ <div class="follow">
+ <a href="https://twitter.com/jwhelton" class="twitter-follow-button" data-show-count="false">Follow @jwhelton</a>
+ <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
+ </div>
+ <div class="tweet">
+ <a href="https://twitter.com/share" class="twitter-share-button" data-url="http://grabgram.com" data-text="Awesome Instagram pic viewing and saving tool" data-via="jwhelton">Tweet</a>
+ <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
+ </div>
+ <div class="like">
+ <iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fgrabgram.com&amp;send=false&amp;layout=box_count&amp;width=450&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=90&amp;appId=162166313824216" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:60px; height:90px;" allowTransparency="true"></iframe>
+ </div>
+ </div>
+ </header>
+ <div id="main">
+
+ <?php
+ //Now rock and roll
+ $feed = json_decode(file_get_contents("https://api.instagram.com/v1/users/".$user->user->id."/media/recent/?access_token=".$user->access_token."&min_timestamp=1286323200"));
+
+ $completed = false;
+ $most_popular = false;
+
+ while(!$completed){
+ foreach ($feed->data as $gram) {
+
+ echo '<div class="gram">
+ <img src="'.$gram->images->low_resolution->url.'" class="image" />
+ <input type="hidden" value="'.$gram->images->standard_resolution->url.'" class="url"/>
+ <div class="dim"></div>
+ <div class="meta">
+ <div class="caption">'.(isset($gram->caption->text)?((strlen($gram->caption->text) > 80)?substr($gram->caption->text, 0, 77)."...":$gram->caption->text):'No Caption').'</div>
+ <div class="likes">Likes: '.$gram->likes->count.'</div>
+ <div class="comments">Comments: '.$gram->comments->count.'</div>
+ <div class="filter">Filter: '.$gram->filter.'</div>
+ <div class="created"><a href="'.$gram->link.'" TARGET="_blank">'.date("j/n/y H:i",$gram->created_time).'</a></div>
+ </div>
+ </div>';
+ if(!$most_popular){
+ $most_popular = $gram;
+ }
+ elseif($gram->likes->count + $gram->comments->count > $most_popular->likes->count + $most_popular->comments->count){
+ $most_popular = $gram;
+ }
+ }
+ if(isset($feed->pagination->next_url)){
+ $feed = json_decode(file_get_contents($feed->pagination->next_url));
+ }
+ else {
+ $completed = true;
+ }
+ }
+
+ ?>
+ </div>
+
+ <div id="popular">
+ <div class="bg"></div>
+ <div class="title">@JWhelton's Most Popular Instagram</div>
+ <div class="likes">Likes: <?=$most_popular->likes->count;?></div>
+ <div class="comments">Comments: <?=$most_popular->comments->count;?></div>
+ <div class="filter">Filter: <?=$most_popular->filter;?></div>
+ <div class="date">Taken: <?=date("j/n/y H:i",$most_popular->created_time);?></div>
+ <div class="gram"><img src="<?=$most_popular->images->low_resolution->url;?>" class="image" /></div>
+ <div class="tweet"><a href="https://twitter.com/intent/tweet?related=jwhelton&text=<?=urlencode("My most popular Instagram: ".$most_popular->link." with ".$most_popular->likes->count." likes, ".$most_popular->comments->count." comments. Find yours here http://grabgram.com");?>" style="color: #fff; font-size:25px;">Click here to tweet this with link to the Instagram...</a></div>
+ </div>
+
+ <footer>
+ <div class="inner">
+ Hacked togther in a couple of hours by <a href="http://twitter.com/jwhelton" style="color: #fff; text-decoration:underline;">@JWhelton</a> while he had the flu. <br />This site isn't gonna exit for $1 Billion, but please buy me some chicken soup: <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=GAMRXNR9T2PJG&lc=IE&item_name=James%20Whelton%20Chicken%20Soup%20Fund&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted" style="color: #fff; text-decoration:underline;">Donate on PayPal</a>
+ </div>
+ </footer>
+
+
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
+ <script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.1.min.js"><\/script>')</script>
+ <script src="js/plugins.js"></script>
+ <script src="js/script.js"></script>
+ <script type="text/javascript">
+ window.onload = function() { $("#loading").fadeOut(); $(".loading-dim").fadeOut();} ;</script>
+ <script>
+ var _gaq=[['_setAccount','UA-30729619-1'],['_trackPageview']];
+ (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
+ g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
+ s.parentNode.insertBefore(g,s)}(document,'script'));
+ </script>
+</body>
+</html>
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
+<cross-domain-policy>
+
+
+<!-- Read this: www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html -->
+
+<!-- Most restrictive policy: -->
+ <site-control permitted-cross-domain-policies="none"/>
+
+
+
+<!-- Least restrictive policy: -->
+<!--
+ <site-control permitted-cross-domain-policies="all"/>
+ <allow-access-from domain="*" to-ports="*" secure="false"/>
+ <allow-http-request-headers-from domain="*" headers="*" secure="false"/>
+-->
+<!--
+ If you host a crossdomain.xml file with allow-access-from domain="*"
+ and don’t understand all of the points described here, you probably
+ have a nasty security vulnerability. ~ simon willison
+-->
+
+</cross-domain-policy>
Binary file not shown.
Oops, something went wrong.

0 comments on commit 284a70d

Please sign in to comment.