Skip to content

Instantly share code, notes, and snippets.

View ryanlewis's full-sized avatar

Ryan Lewis ryanlewis

  • Leeds, United Kingdom
  • 22:32 (UTC +01:00)
View GitHub Profile
@ryanlewis
ryanlewis / Program.cs
Created July 29, 2013 23:00
LinqToTwitter example to fetch tweet data for a particular tweet
using System;
using System.Linq;
using System.Text.RegularExpressions;
using LinqToTwitter;
namespace TweetTest
{
internal class Program
{
private static readonly Regex TweetStatusRegex = new Regex(@"^https?:\/\/twitter\.com\/(?:#!\/)?(\w+)\/status(es)?\/(\d+)$");
JSON.stringify = JSON.stringify || function (obj) {
var t = typeof (obj);
if (t != "object" || obj === null) {
// simple data type
if (t == "string") obj = '"'+obj+'"';
return String(obj);
}
else {
// recurse array or object
var n, v, json = [], arr = (obj && obj.constructor == Array);