Twitter notification broken with Graffiti 1.2?

Nope, but, boy, was it a coincidence! I use Scott Watermasysk's Graffiti Plug-in library to add Twitter notifications when I add new posts to this blog. Well, the weekend before last, I upgraded to Graffiti CMS 1.2 and blogged about it. The plug-in duly tweeted it. No problem.

The next post I made, on 23-Dec about Dell XPS support, wasn't. I eventually noticed, and wrote a fake manual tweet, resolving to work out what the issue was. Ditto for the next few blogs — it seems my resolutions don't have the force of real action — until this lunchtime, when I buckled down with some reheated Chick-fil-A nuggets to work out the problem.

Since the Twitter notification failure happened after I'd installed Graffiti 1.2, I couldn't really blame the upgrade. I looked at the Graffiti log and saw an error that looked like this:

Twitter Plugin

Your tweet could not be sent: The remote server returned an error: (417) Expectation Failed.

Ha! Moments later, using the famed tech support line that is Google, I came across this blog post that detailed the exact problem. Twitter in their infinite wisdom don't accept the "100-Continue" expectation http header any more. The default for .NET apps is to supply it, and therefore .NET Twitter notification code has been failing ever since 23 December.

Since Scott provides the source code to his plug-in, it was the matter of moments to add the single line of code to turn off the 100-Continue expectation...

   1: //...
   2:  
   3: // Create the web request  
   4: System.Net.ServicePointManager.Expect100Continue = false; // <-- new line
   5: HttpWebRequest request =
   6:     WebRequest.Create("http://twitter.com/statuses/update.xml") as HttpWebRequest;
   7:  
   8: //...

..and this post will be the test.

Album cover for G-Stoned Now playing:
Kruder & Dorfmeister - Definition
(from G-Stoned)



Posts on similar topics...

9 Responses

  • Sun 04 Jan 2009
  • 9:58 AM
  •  avatar #1

doWhileSomething said...

Thanks for this, I wish some kind of distribution list could be created for users of their API.

This worked like a charm!

  • Sun 04 Jan 2009
  • 10:45 AM
  • julian m bucknall avatar #2

julian m bucknall said...

Glad it helped!

Cheers, Julian

  • Fri 20 Feb 2009
  • 12:59 PM
  •  avatar #3

Blog to Twitter Interface - Fixed said...

Well, who would have thought that if I would have just went and spent 2 minutes and Googled the stupid error I was getting that a solution would have been found &lt;smack&gt;. Thanks to Julian Bucknall ( blog.boyet.com/.../twitter-notific

  • Sat 07 Mar 2009
  • 5:43 AM
  •  avatar #4

Henrik said...

Thanks, Julian.

Could you post the DLL with the fix for download?

  • Sat 07 Mar 2009
  • 9:27 AM
  • julian m bucknall avatar #5

julian m bucknall said...

Henrik: I'll ping Scott to update his download with the fix, but until then you can get it here boyetblog.s3.amazonaws.com/.../ScottWater.Graf

Cheers, Julian

  • Thu 19 Mar 2009
  • 12:34 AM
  •  avatar #6

tonex said...

I wonder why this doesn't work on mine. I'm using VS2008 and 3.5 Framework. I still get the 417 error.

  • Fri 20 Mar 2009
  • 9:55 AM
  • julian m bucknall avatar #7

julian m bucknall said...

Tonex: That I don't know, but make sure you are replacing the dll properly on your site. I was using VS2008 and .NET 3.5 as well.

Cheers, Julian

  • Sun 29 Mar 2009
  • 9:58 AM
  •  avatar #8

regmee said...

Same with me. I couldn't get it fixed with the Expect100Continue fix. I guess, something more is broken now. Even the tested application QckTwit (http://qcktwit.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=21094#ReleaseFiles) with the correction doesn't seem to work.

Any idea ???

  • Sat 06 Jun 2009
  • 5:35 AM
  •  avatar #9

infopete said...

I've been having exactly the same problem using Quakk and my new twitter application.

I have just solved the problem with this:

webRequest.ProtocolVersion = HttpVersion.Version10;

This is under windows mobile using CF2.0

I hope it works for you too.

Leave a Response

Some MarkDown is allowed, but HTML is not. (Click to learn more.)

  • Emphasize with italics: surround word with underscores _emphasis_
  • Emphasize strongly: surround word with double-asterisks **strong**
  • Inline code: surround text with backticks `IEnumerable`
  • Unordered list: start each line with an asterisk, space * an item
  • Ordered list: start each line with a digit, period, space 1. an item
  • Insert code block: start each line with four spaces
  • Insert blockquote: start each line with right-angle-bracket, space > Now is the time...

Search

About Me

I'm Julian M Bucknall, the M because it's my middle initial and because I and the other Julian Bucknall (the movie guy) would like to differentiate ourselves.

I'm a programmer by trade, an actor by ambition, and an algorithms guy by osmosis. I write articles for PCPlus in my spare time, not that there's much of that.

Julian M Bucknall Apart from that, an ex-pat Brit, atheist, microbrew enthusiast, Pet Shop Boys fanboy, slide rule and HP calculator collector, amateur photographer, Altoids muncher.

DevExpress

I'm Chief Technology Officer at Developer Express, a software company that writes some great controls and tools for .NET and Delphi. I'm responsible for the technology oversight and vision of the company.

Validation

Validate markup as HTML5 (beta)     Validate CSS

Bottom swirl

Archives

February 2012 (3)
SMTWTFS
« Jan  
1234
567891011
12131415161718
19202122232425
26272829

Like this Archive Calendar widget? Download it here.

Social networking

Google ads

The OUT Campaign

The OUT Campaign

My Tweets

  • @TerriMorton "The Texan-ized Eiffel Tower" <shudders, whimpers in corner> /cc @rachelreese
  • One of my blog readers found this awesome picture of Roger Moore modeling a pullover in a "Father and Son" pattern http://t.co/DRs4dLSu
  • @RachelHawley First Vaseline, then a drill. It's a good job I have no imagination.
Bottom swirl