mortonfox: (Robot)
A few days ago, I wrote a proof-of-concept Twitter OAuth login and posting script in Perl. Today, with no interruptions from anything or anyone (even the mail carrier was extra quiet), I added the code to TwitVim. (revisions 88 to 92) The only part of the OAuth handshake and signing code that I couldn't yet write in Vim script is the HMAC-SHA1 message digest code. I'm using Perl to do that but I'll look for other ways.

The impression I got while working with Twitter OAuth is the API itself is an unfinished work with some rough edges and inconsistencies. For example, the documentation for statuses/home_timeline states that this call supports only the GET request method. This is true for basic authentication but once you switch to OAuth, it requires the POST method if you add any optional parameters. statuses/user_timeline, on the other hand, disallows POST even if you're using the optional parameters. I suspect the documentation is out of date and statuses/user_timeline will eventually be modified to be consistent with the other timeline calls but with Twitter, it's anyone's guess.

Twitter's OAuth implementation itself is not fully documented. I figured out a few things about what it does and does not allow by experimenting with my demo Perl script. I tried not to make too big a change at a time because it's tough to debug. Any error simply results in a "401 Unauthorized". It doesn't matter if you misspelled the signature method, if your nonce is not unique enough, or if your timestamp is not fresh enough. You'll get the same error code. Also, Twitter can and will throw a fail whale in the middle of an OAuth handshake, which is a consideration if your app is expected to handle this problem gracefully.

So what's left to do? TwitVim needs to save the access token after doing an OAuth handshake so it won't have to re-authenticate every time it starts up. Once it does that, it also needs to offer a way for the user to switch to another login. And of course, I need to document all of this so the user will know how to set it up.
mortonfox: (face tree)
May have overdone yesterday's hike but that's okay. It's time for a day of rest anyway. So in the morning and early afternoon, I worked on some Twitter OAuth code for the next release of TwitVim. There is an actual deadline for this too because Twitter is planning to turn off basic authentication on June 30. Later on, I'll also have to see whether this code can be added to my Twitter utility scripts.

In the evening, I did yardwork. Cut the grass in both front and back yards. This time, it took about 90 minutes. I'm trying to improve efficiency. It's an electric lawnmower so cord management is key. Also, I noticed that turning the lawnmower around 180 degrees is more time-consuming than turning it 90 degrees. So far, I've come up with a scheme where I mow in concentric rectangles from edge to center. This differs from the recommendation in the lawnmower manual, which involves 180-degree turns. Going from edge to center has the advantage of piling up grass clippings in the center. The backyard is a bit tricky because of the odd layout there. I divided the area into two rectangles and that seemed to work well except for the far edges and corners. I still have to use the hand clippers in the corners.

While mowing the lawn, I noticed some small red berries in the grass. There are two kinds of weeds in this area that produce those, so I got some plant samples to study and do a proper identification. I think it is mock strawberry based on the shape of the leaves and the way the berry sticks up instead of drooping. A flower sample would be a sure way to differentiate this plant from wild strawberry but I couldn't find any flowers. This is disappointing because wild strawberries would at least be usable as food whereas mock strawberries are flavorless.

Profile

mortonfox: (Default)
Morton Fox

May 2020

S M T W T F S
     12
3 456789
10111213141516
17181920212223
24252627282930
31      

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags