Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $today = date("Ymd");
- $likes = 0;
- $todo = 0;
- echo "<table border='1' cellspacing='0' cellpadding = '1' id='resultTable'>";
- echo "<thead><tr><th style = 'width: 75px;'>Tip Date</th><th style = 'width: 100px;'>Venue Name</th><th style = 'width: 200px;'>Tip Text</th><th style = 'width: 50px;'>Likes</th><th style = 'width: 50px;'>Saves</th></tr></thead><tbody>";
- $url="https://api.foursquare.com/v2/lists/{user-id}/tips?oauth_token={oauth_token}&limit=200&v={$today}";
- $source = file_get_contents($url);
- $obj = json_decode($source, true);
- foreach($obj['response']['list']['listItems']['items'] as $item)
- {
- echo "<tr>";
- echo "<td style = 'width: 75px;'>" . date('m/d/y', $item['createdAt']) . "</td>" ;
- echo "<td style = 'width: 200px;'>" . $item['venue']['name'] . "</td>" ;
- echo "<td style = 'width: 400px;'>" . $item['tip']['text'] . "</td>" ;
- echo "<td style = 'width: 50px; text-align: center;'>" . $item['tip']['likes']['count'] . "</td>" ;
- echo "<td style = 'width: 50px; text-align: center;'>" . $item['tip']['todo']['count'] . "</td>" ;
- echo "</tr>";
- $likes += $item['tip']['likes']['count'];
- $todo += $item['tip']['todo']['count'];
- }
- $url="https://api.foursquare.com/v2/lists/{user-id}/tips?oauth_token={oauth_token}&limit=200&offset=200&v={$today}";
- $source = file_get_contents($url);
- $obj = json_decode($source, true);
- foreach($obj['response']['list']['listItems']['items'] as $item)
- {
- echo "<tr>";
- echo "<td style = 'width: 75px;'>" . date('m/d/y', $item['createdAt']) . "</td>" ;
- echo "<td style = 'width: 200px;'>" . $item['venue']['name'] . "</td>" ;
- echo "<td style = 'width: 400px;'>" . $item['tip']['text'] . "</td>" ;
- echo "<td style = 'width: 50px; text-align: center;'>" . $item['tip']['likes']['count'] . "</td>" ;
- echo "<td style = 'width: 50px; text-align: center;'>" . $item['tip']['todo']['count'] . "</td>" ;
- echo "</tr>";
- $likes += $item['tip']['likes']['count'];
- $todo += $item['tip']['todo']['count'];
- }
- $url="https://api.foursquare.com/v2/lists/{user-id}/tips?oauth_token={oauth_token}&limit=200&offset=400&v={$today}";
- $source = file_get_contents($url);
- $obj = json_decode($source, true);
- foreach($obj['response']['list']['listItems']['items'] as $item)
- {
- echo "<tr>";
- echo "<td style = 'width: 75px;'>" . date('m/d/y', $item['createdAt']) . "</td>" ;
- echo "<td style = 'width: 200px;'>" . $item['venue']['name'] . "</td>" ;
- echo "<td style = 'width: 400px;'>" . $item['tip']['text'] . "</td>" ;
- echo "<td style = 'width: 50px; text-align: center;'>" . $item['tip']['likes']['count'] . "</td>" ;
- echo "<td style = 'width: 50px; text-align: center;'>" . $item['tip']['todo']['count'] . "</td>" ;
- echo "</tr>";
- $likes += $item['tip']['likes']['count'];
- $todo += $item['tip']['todo']['count'];
- }
- $url="https://api.foursquare.com/v2/lists/{user-id}/tips?oauth_token={oauth_token}&limit=200&offset=600&v={$today}";
- $source = file_get_contents($url);
- $obj = json_decode($source, true);
- foreach($obj['response']['list']['listItems']['items'] as $item)
- {
- echo "<tr>";
- echo "<td style = 'width: 75px;'>" . date('m/d/y', $item['createdAt']) . "</td>" ;
- echo "<td style = 'width: 200px;'>" . $item['venue']['name'] . "</td>" ;
- echo "<td style = 'width: 400px;'>" . $item['tip']['text'] . "</td>" ;
- echo "<td style = 'width: 50px; text-align: center;'>" . $item['tip']['likes']['count'] . "</td>" ;
- echo "<td style = 'width: 50px; text-align: center;'>" . $item['tip']['todo']['count'] . "</td>" ;
- echo "</tr>";
- $likes += $item['tip']['likes']['count'];
- $todo += $item['tip']['todo']['count'];
- }
- $url="https://api.foursquare.com/v2/lists/{user-id}/tips?oauth_token={oauth_token}&limit=200&offset=800&v={$today}";
- $source = file_get_contents($url);
- $obj = json_decode($source, true);
- foreach($obj['response']['list']['listItems']['items'] as $item)
- {
- echo "<tr>";
- echo "<td style = 'width: 75px;'>" . date('m/d/y', $item['createdAt']) . "</td>" ;
- echo "<td style = 'width: 200px;'>" . $item['venue']['name'] . "</td>" ;
- echo "<td style = 'width: 400px;'>" . $item['tip']['text'] . "</td>" ;
- echo "<td style = 'width: 50px; text-align: center;'>" . $item['tip']['likes']['count'] . "</td>" ;
- echo "<td style = 'width: 50px; text-align: center;'>" . $item['tip']['todo']['count'] . "</td>" ;
- echo "</tr>";
- $likes += $item['tip']['likes']['count'];
- $todo += $item['tip']['todo']['count'];
- }
- $url="https://api.foursquare.com/v2/lists/{user-id}/tips?oauth_token={oauth_token}&limit=200&offset=1000&v={$today}";
- $source = file_get_contents($url);
- $obj = json_decode($source, true);
- foreach($obj['response']['list']['listItems']['items'] as $item)
- {
- echo "<tr>";
- echo "<td style = 'width: 75px;'>" . date('m/d/y', $item['createdAt']) . "</td>" ;
- echo "<td style = 'width: 200px;'>" . $item['venue']['name'] . "</td>" ;
- echo "<td style = 'width: 400px;'>" . $item['tip']['text'] . "</td>" ;
- echo "<td style = 'width: 50px; text-align: center;'>" . $item['tip']['likes']['count'] . "</td>" ;
- echo "<td style = 'width: 50px; text-align: center;'>" . $item['tip']['todo']['count'] . "</td>" ;
- echo "</tr>";
- $likes += $item['tip']['likes']['count'];
- $todo += $item['tip']['todo']['count'];
- }
- echo "</tbody></table>";
- echo "<h3>Totals</h3>";
- echo "Likes: " . $likes . "<br>" ;
- echo "Saves: " . $todo;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement