LINQ to Twitter v2.1.09 Released

Today, I released v2.1.09. Here are important new changes.

Bug Fixes

This is primarily a bug fix release. Most notably, there were authentication problems in WinRT apps. This is now fixed.

New Features

One new feature is the addition of ApplicationOnlyAuthentication for WinRT. It is fully async.  Here’s how it works:

var auth = new WinRtApplicationOnlyAuthorizer { Credentials = new InMemoryCredentials { ConsumerKey = "", ConsumerSecret = "" } };

if (auth!= null &&!auth.IsAuthorized) { await auth.AuthorizeAsync; }

var twitterCtx = new TwitterContext(auth);

(from search in twitterCtx.Search where search.Type == SearchType.Search && search.Query == SearchTextBox.Text select search) .MaterializedAsyncCallback( async response => await Dispatcher.RunAsync( CoreDispatcherPriority.Normal, async => { Search searchResponse = response.State.Single; string message = string.Format( "Search returned {0} statuses", searchResponse.Statuses.Count);

await new MessageDialog(message, "Search Complete").ShowAsync; }));

It’s called the WinRtApplicationOnlyAuthorizer. You only need two tokens, ConsumerKey and ConsumerSecret, which come from your Twitter API application settings page.

Note: You need a Twitter Application, which you can create at https://dev.twitter.com/.

The MaterializedAsyncCallback materializes your query and handles the response. I put everything together in a lambda for demonstration purposes, but you can always replace the callback with a handler of type Action>>, where T is Search for this example.

On the Horizon

The next version of LINQ to Twitter is in development. I discussed it at LINQ to Twitter Async. This isn’t complete, but you can download the source code at the. I’ve competed all the spikes for what I thought would be the hard parts and now have prototypes of queries and commands working. This would be a good time to provide feedback if there are features in the current version that you think could be improved. The current driving forces for the next version will be async and PCL.

@JoeMayo

This article is part of the GWB Archives. Original Author: Joe Mayo

New on Geeks with Blogs

  • We Won The One Award I Actually Care About

    Full Scale made the Inc. 5000 for the fifth year straight, the 12th listing across my three companies. Here is why the one award you cannot buy is worth stopping for.

  • Your Customers Build the Features Now

    I let a tool I liked sit dead for a year rather than build the features I wanted. An MCP server meant I never had to, and your customers can do the same to your product.

  • Get the Size of a Directory in Linux the Easy Way

    du -sh for the quick answer, ncdu for the cleanup, df for the disk itself: every command for checking directory size in Linux, plus why du and df never agree.

  • Vim Search and Replace: The Ultimate Guide

    One :%s command replaces every match in a file before a find dialog would even open. The Vim substitute patterns worth the muscle memory: flags, ranges, capture groups, and multi-file edits.