thoughts from a hungry geek

Tagged with twitter …

Overdone jokes aside, I realized that I use Trowl too much, and I invested too much time in the app, to just toss it aside when Twitter decided to finally turn off version 1 of its API. That said, it’s not a trivial process.

Technical Details

If you’re interested, Trowl was originally built on requesting XML responses from Twitter. This was primarily because, at the time, .NET was best suited for parsing XML documents more than anything else. With the switch to API 1.1, Twitter completely dropped the ability to request XML responses, in favor of JSON. Luckily, .NET has become more fluent with JSON recently – but it still meant going back through all my calls to Twitter and replacing the XML-based response/parse logic with JSON-based response/parse logic.

The Status of 0.8

Okay, so, I’m making this version 0.8 because I’m essentially changing the entire foundation that Trowl is based on. There aren’t any new features here, but it’s a big enough infrastructure change that I felt justified in bumping up the version to 0.8.

I’ve converted almost everything over to API 1.1 except the following:

I’m making a development version of 0.7.3 available for anyone who would like to help me test it before it’s released to everyone. This version has better stream error recovery handling, and makes a couple of other minor under-the-hood changes. The most noticeable change, though, is Tweet Marker support.

What is Tweet Marker?For those who aren’t yet familiar with the service, Tweet Marker syncs your Twitter timeline across applications by recording the last tweet you read. Applications that support Tweet Marker can quickly jump straight to the spot in your timeline where you left off.

How does that work for Trowl?Since Trowl doesn’t show you a traditional Twitter timeline (at the moment…), it uses this information a little differently.

Saving your last read tweet: in Trowl, a tweet is considered “read” when its notification is dismissed. Every 15 seconds, it will send the tweet that was last dismissed to Tweet Marker.

Retrieving your last read tweet: every 5 minutes, Trowl will pull the latest Tweet Marker from the server. It can’t remove any tweet notifications already on screen, but it won’t send new notifications for tweets you’ve already seen. Instead, it will pick up with the first new tweet. Depending on your settings, this will also happen when you uncheck the Silence option.

How do you enable Tweet Marker?Tweet Marker has been added as one of the “missed tweets” options:

This option covers both tweets and mentions.

I’ve also updated Metro Display slightly. In addition to the coalescing support that I added a little while back, I also changed it so that the Twitter timestamp dynamically updates – this should have been added a long time ago, so I apologize for the wait. I also fixed a nasty memory leak bug.

For those who aren’t in the know, Big Macintosh is a character on the cartoon My Little Pony: Friendship is Magic. It’s a slight re-imagining of the original show, headed by the same creative mind behind Foster’s Home for Imaginary Friends – an awesome show with clever writing. Needless to say, that same maturity (but kid-appeal) carries over to the new My Little Pony. I suppose I should clarify that I’m not enough of a fan to call myself a brony, but I do think the show is about 20% cooler than most other things on television – and Big Macintosh is by far my favorite character. :)

I’ve always wanted to make a Twitter bot, so I jumped at the opportunity. In this post, I’d like to share some of the technical details, and decision making, that brought @BigMacinbot to life.

Preview builds are now available. I waited until things seemed relatively stable, so if you want to give 0.7 a whirl, you shouldn’t experience too many problems. Of course, if you do, I’d love to hear about it. Then I can fix it and everything will be happy again. :)

While 0.7 is mostly finished, there are still a few small features that I’d like to add. I didn’t want the preview builds to get held up by these last few changes, but you can expect a couple more goodies to slip through before things are finalized.

So, what are those features? Thank you for asking, imaginary commenter!

* New "Event" notification.(NOW AVAILABLE in build 002) The user stream sends more than just tweets — it also sends notifications about new followers, retweets and favorites. So it only seemed appropriate to pass those notifications on to Growl. As new notifications get sent to the stream, I’ll integrate them into this notification type.

* Complete t.co integration.(NOW AVAILABLE in build 003) Twitter is finally starting to push ahead with implementing its t.co URL "shortening" service to the rest of its ecosystem. To that end, Trowl will behave slightly differently when posting a tweet with URLs. Each URL will automatically deduct ~19 characters from your tweet, no matter how long the URL is. My current plan is to keep the built-in is.gd shortening available for those who like to use that, but it’ll probably become less important as t.co becomes more widespread.

* Photo uploads. (NOW AVAILABLE in build 004) I think everyone knows what this is now that Twitter has rolled it out to everyone on the Twitter website. It is not yet (officially) part of the API, though, and currently Twitter has no date planned for a roll out. (So much for late June.) Like mentioned above, this may or may not make it into 0.7 depending on how long this takes.

* Higher resolution profile pictures. (NOW AVAILABLE in build 005) Profile pictures will now be 200 by 200 pixels, if possible. A lot of profile pictures aren’t that large when pulled from Twitter, so some changes were made to how the retweet profile pictures are composed. Overall, though, you shouldn’t notice too much of a difference unless you are using a Growl display that shows large images, or you forward notifications to another device, like Howl on iPhone. Metro Display was changed to show a larger version of the profile picture if you hover your mouse over the profile picture.

Now that my experimental project is out there in the wild (have you tried it yet? please try it!), it’s time to move on to something a bit more stable and mainstream: Trowl.

I feel a little bad that it has been almost a year since the last big release, Trowl 0.6. Between other projects that I have been working on, and Twitter’s announcement (“read our tweets, no new clients!”), Trowl has been put on the back burner. The good thing about that, though, is that it has given me time to think of ways to improve the program, and collect feedback about what others would like to see too.

Today, I’d like to give you a preview of all the new shinies in Trowl 0.7.

All right, so I’ve been teasing this guy for a little while. I think it’s time I let the cat out of the bag.

So what is it? Put simply, it searches Twitter for desktop wallpaper, adds what it finds to your library, and then randomly sets your computer’s wallpaper to one of the images at regular intervals.

I forget what, exactly, prompted me to start working on this project. I think it had something to do with the fact that there are a lot of images out there that make excellent wallpapers – but they’re a bit hard to find. A few websites have popped up recently that have helped with this task, but it’s usually pages upon pages of images that takes a lot of time to sift through.

But Twitter is a great natural filter – people usually don’t tweet something unless it warrants it. (Excluding things like spam or commercial accounts, of course.) So, I started working on this little program.

At this point, it’s a proof of concept. It’s not in any sort of polished, final form. All the features work in a “this is alpha code and may break” sort of way. It searches Twitter for tweets with the “#wallpaper” hashtag, and then looks for any URLs. If one of the URLs points to an image, it pulls it down and adds it to a temporary list – the lower “Twitter” section in the screenshot above.

Selecting a wallpaper shows who tweeted it, and what the original text of the tweet was. When you mouse over a wallpaper, you also get three options:

The top button removes an image from your library. Because you may sometimes come across images that you don’t particularly like, the program asks if you want to exclude this picture from ever showing up again. If you say yes, then it’ll be added to an exclusion list that will stop it from showing up again – regardless of who tweets it.

The middle button pins the wallpaper. Pinned wallpapers are images you want to keep in your library. They appear in the section on top, as seen in the screenshot above, and won’t disappear if you restart the application. If you ever decide you don’t want to keep a wallpaper, you can unpin it. (To indicate that it is pinned, the wallpaper will keep showing the pinned icon, even after you mouse away from it.)

The bottom button magnifies the wallpaper. In this view, it fills the entire upper portion of the program. You can click anywhere on the zoomed version to dismiss it. Keep in mind that you can resize the main window (or fully maximize it) – which will also expand the size of the magnified image.

There is also a small settings screen that you can access by clicking the button with the gear on it, in the lower right. From this screen, you can control how often Twitter is searched, how often your wallpaper should change, and what the minimum size an image should be in order to be included in the library.

And speaking of changing the wallpaper – it will randomly choose an image, either from your pinned list, or the images it has found on Twitter. So if you don’t want an image to show as a wallpaper, it is best to remove it.

A few last points: by default, a wallpaper image is named the URL it was pulled from. But you can rename it to anything you want – selecting the thumbnail lets you change the text below it. You can close the main window any time – it will sit in your system tray. Double click the icon to re-open the window, or right click to Exit. When you first start the program, it won’t check Twitter right away. It will start at the next scheduled interval. You will know it’s checking Twitter, as there will be a green progress bar in the “Twitter” header bar.

I think that’s it as far as features go. I’m offering this proof of concept version as a way to gauge what people think of it. I have a lot of interesting ideas for where this could go – but with both Trowl and Project Nom being actively developed, I don’t want to spend a lot of time on this unless it’s something people would actually use and enjoy.

So if you like it, let me know! And if you don’t like it, let me know that too – but let me know what could be done to improve it.

In any case, I hope you like playing with this as much as I have. You’ll notice that there aren’t too many #wallpaper tweets that actually link directly to an image, so if you have any wallpapers you can share with a #wallpaper tag on Twitter, please do! And I’ll do the same.

Twitter recently announced that they’re adjusting application permissions such that DMs require a new level of access. To ensure that users know exactly what is being accessed by the programs they use, Twitter wants users to re-authorize applications that require DM access.

If you use Trowl to view DMs, or you use the DM remote feature, you will need to re-authorize Trowl to access your DMs. otherwise you will start getting errors at the end of June.

Luckily, it’s pretty easy to do this. The first step is to go to the settings screen and click on ‘Add Account’, like the screenshot at the right shows. This will take you to the usual authorize screen, as if you were adding a brand new account. Click the link, and you will be taken to the Twitter website to authorize your account. The screenshot below shows the important part – that you will be allowing Trowl to access your direct messages.

After you enter your username and password, you will get the pin to enter back in Trowl. After you do this, Trowl will realize you authorized an account you already have set up, and will simply update your existing account with the new authorization. You will need to repeat this process for all accounts you use with Trowl. Click ‘Save’ to confirm the new authorizations and you’re done.

(One other minor thing to note: I run Trowl on several computers, and each instance is authorized for the same Twitter accounts. One thing I noticed is that as soon as I re-authorized one instance of Trowl with the new access permissions, the access permissions used by the other instances of Trowl instantly became invalid. So, if you have a similar situation, you will need to update every instance of Trowl. I imagine this isn’t a common situation, but wanted to mention it just in case.)

What if I don’t want Trowl to access my DMs?If you actually don’t want Trowl touching your DMs for whatever reason, then you can either refuse to re-authorize Trowl – in which case you will get errors whenever Trowl attempts to access them – or you can change your settings to not Growl DMs or use remote DM commands.

This is a bit of a nuisance, so thank you for taking a minute to do this. I understand Twitter’s motivations, but I can’t help but think there must have been a more streamlined way to implement this.

Today, I’m releasing a minor update to Metro Display and Twitter Display. For Metro Display, it will now properly display twitpic/yfrog images if the links were shortened by t.co. For both displays, they will now properly link mentions/hashtags/URLs if they appear more than once in the tweet. They can both be downloaded from the usual location. You may need to delete your current versions of the displays before installing the new versions.

Even so, I’ve been working on Trowl, and I’m happy to make available the preview for Trowl 0.6. So why 0.6 when the last version was 0.5.4? Well, first of all: we’re talking about 0.0.6 of a version – does it really matter? ;) But more technically, I’ve made a lot of changes, both to the code behind the scenes and to what you see in the behavior and UI of the app. While a lot of the changes aren’t particularly groundbreaking, taken together I think they offer a substantial improvement to 0.5.4.

Before I give you the download link, I wanted to go over a few of the larger changes so you know what you’re getting into.

Backend CodeI mentioned that I made changes to the code that aren’t immediately obvious on the surface. This includes changes with the Twitter API: some of the calls are updated, and I further refined how Trowl checks your rate limit. There have also been changes to how Trowl parses the results it gets back from Twitter. Finally, I’ve made some modifications to how notifications are sent and received from Growl. Observant users will notice that I added the word “try” to the “show X number of notifications on screen at once” setting. I’ve made this a bit more flexible to handle occasional lost notifications or other oddities. So if you sometimes see more or less than your desired number of notifications, don’t freak out. :)

Different Growls for Different AccountsA new advanced notification setting will force Trowl to register a separate “New Tweet” notification type for each of your Twitter accounts. What does this mean? Well right now, if you open Growl and look at Trowl’s notifications, you will see just one “New Tweet” notification type. If you switch this setting on, however, it will create a “New Tweet” notification type for each of your Twitter accounts. What’s the point? By doing this, you can configure each account separately. Want one account to forward to iPhone, and another not? Want one account’s notifications to be sticky, but another to close automatically? Now you have the power.

New TweetYou can now use the hotkey CTRL-SHIFT-T to open the New Tweet window from anywhere. (Update: You can now toggle the hotkey option, as well as what the hotkey is.) Also, some minor layout changes were made to this screen. Finally, I added a button to let you switch between reply and retweet. Why? Well, have you ever accidentally hit “reply” instead of “retweet” or vice versa? Or did you hit “retweet”, only to realize you’d rather do an “old style” retweet? Now you can quickly switch between the two types right from the New Tweet screen.

Refined Catch-Up TweetsFor a while now, Trowl has offered the ability to show the tweets you “missed” while it was closed. Using a special “while you were gone” notification type, it would show all the tweets you would have normally seen if you hadn’t quit Trowl. You can now toggle this option to show all tweets, or just replies and mentions. (Of course, if you already have the account set up to only growl replies and mentions, this toggle will make no difference.)

Refined Silence ModeIn previous versions, “Silence” mode would simply cause Trowl to stop checking for new tweets. When you turned Silence off, it would show all the tweets you missed while it was silent. Now the default action is to not display any missed tweets. If you still want it to do this, “show missed tweets” has an option to include Silence mode.

Auto-SilenceRelated to the previous section, Trowl can now detect when your computer goes to sleep. When it does so, you can have Trowl automatically go into Silence mode. When it comes out of sleep, it will turn off Silence, and then show what tweets you missed, if you configured it to do so.

Settings BackupA new button was added to make a backup of your settings. It puts a file in a location that can be seen by all Trowl versions. If for some reason Trowl loses track of your settings (usually after a version upgrade) it will look for a backup and restore from it. You can also use the backup file to easily transfer settings to another computer, or do a manual reset if something bad happens.

… and more. There have been lots of other minor changes and tweaks too. This is actually a slightly more rough “preview” version than in the past. So don’t be surprised if you find any bugs – just let me know in the comments here, or at the Google Group, and I’ll update this post with any bug fix versions as necessary.

So if you get a chance, please download and try out the preview version. I look forward to any feedback you may have. Thanks!