Getting new Twitter API consumer and secret keys

To get Consumer Key & Consumer Secret, you have to create an app in Twitter via https://developer.twitter.com/en/apps Then you’ll be taken to a page containing Consumer Key & Consumer Secret. Hopefully this information will clarify OAuth essentials for Twitter: Create a Twitter account if you don’t already have one Visit ‘https://apps.twitter.com’ and follow the required … Read more

Pretty-Print JSON Data to a File using Python

You should use the optional argument indent. header, output = client.request(twitterRequest, method=”GET”, body=None, headers=None, force_auth_header=True) # now write output to a file twitterDataFile = open(“twitterData.json”, “w”) # magic happens here to make it pretty-printed twitterDataFile.write(simplejson.dumps(simplejson.loads(output), indent=4, sort_keys=True)) twitterDataFile.close()

{” was not expected.} Deserializing Twitter XML

Either decorate your root entity with the XmlRoot attribute which will be used at compile time. [XmlRoot(Namespace = “www.contoso.com”, ElementName = “MyGroupName”, DataType = “string”, IsNullable=true)] Or specify the root attribute when de serializing at runtime. XmlRootAttribute xRoot = new XmlRootAttribute(); xRoot.ElementName = “user”; // xRoot.Namespace = “http://www.cpandl.com”; xRoot.IsNullable = true; XmlSerializer xs = new … Read more

Find objects between two dates MongoDB

Querying for a Date Range (Specific Month or Day) in the MongoDB Cookbook has a very good explanation on the matter, but below is something I tried out myself and it seems to work. items.save({ name: “example”, created_at: ISODate(“2010-04-30T00:00:00.000Z”) }) items.find({ created_at: { $gte: ISODate(“2010-04-29T00:00:00.000Z”), $lt: ISODate(“2010-05-01T00:00:00.000Z”) } }) => { “_id” : ObjectId(“4c0791e2b9ec877893f3363b”), “name” … Read more

What’s the shebang/hashbang (#!) in Facebook and new Twitter URLs for?

This technique is now deprecated. This used to tell Google how to index the page. https://developers.google.com/webmasters/ajax-crawling/ This technique has mostly been supplanted by the ability to use the JavaScript History API that was introduced alongside HTML5. For a URL like www.example.com/ajax.html#!key=value, Google will check the URL www.example.com/ajax.html?_escaped_fragment_=key=value to fetch a non-AJAX version of the contents.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)