Skip to content

Instantly share code, notes, and snippets.

@shamess
shamess / gist:efc177775bb1750795a9740012b7fcec
Created September 14, 2016 09:57
What a GNIP quoted_tweet looks like
{
"actor": {
"displayName": "The 6",
"favoritesCount": 1224,
"followersCount": 623,
"friendsCount": 570,
"id": "id:twitter.com:1335256172",
"image": "https://pbs.twimg.com/profile_images/692291771234140161/8N_MZvwt_normal.jpg",
"languages": [
"en"
@shamess
shamess / php-twitter-loop.php
Created April 17, 2012 14:07
Loop over some tweets, in PHP
<?php
$twitter_user = "shamess";
$json = file_get_contents ("http://api.twitter.com/1/statuses/user_timeline.json?screen_name=".$twitter_user."&count=3&trim_user=true");
$tweets = json_decode ($json);
echo "<ul>";
foreach ($tweets as $tweet) {
$tweet_text = $tweet->text;
@shamess
shamess / PRG pattern in PHP
Created January 6, 2012 02:23
An interpretation of the PRG pattern, using PHP.
<?php
session_start ();
if ($_POST['some_text']) {
$_SESSION['some_text'] = $_POST['some_text'];
header ('HTTP/1.1 303 See Other');
header ('Location: ./');
} else {