Archive for Web junkie

Twitmon update: read and post to Twitter on the command line

I've posted a new version of Twitmon, my Python command-line Twitter client.  The new version includes a fix to work with the latest version of Twyt, but more importantly, it can now be used to post status updates to Twitter as well!

Download: twitmon, and don't forget to set your username and password in the script!

Twitmon will fetch new Twitter updates from your followees every couple of minutes, just as before.  But now you can update your status as well, just by typing the new status and hitting enter.

You can also edit the update as you're typing it, and use the arrow keys to navigate back and forth through updates you've previously typed.

Occasionally, the Twitter posts will be refreshed while you're typing, and mess up the display.  You can use the arrow keys to go back, then forward, to clean things up.  It's ugly when this happens, but it still works.


Tags: , ,
Comments (2)

Twitmon: command-line Twitter reader

I've been feeling dissatisfied while trying to read the Twitter statuses of people I'm following. What I usually want to do is read everything that has come in since the last time I posted something. Unfortunately, this is hard to do on Twitter's website. I have to go back through the pages, one by one, to find my last tweet, then start reading upwards and backwards until I get to the beginning again. It's a lot of work and the page load times could be better, so it leaves a lot to be decided.

Twitmon screenshotI decided to use the Twitter API to write a command-line client that would check Twitter every so often and spit out new updates. Turns out I didn't need to do much work: Twyt is an existing Python implementation of the API. I was going to write it in Python anyway, so I downloaded Twyt (on Ubuntu: sudo apt-get install python-twyt) and started poking around.

It wasn't immediately clear how to get started, but I read through Twyt's files until I figured out how to authenticate, fetch status data, and turn it into usable objects. I added some extra stuff to print out color text and to periodically check Twitter, and I've got something I can really use. The code is here: twitmon.

I haven't tested it on Windows; it should work in general, but the text colors may not. The colors can be turned off in the script. Normally, it will use the colors to highlight links and usernames. It will also highlight the current user's username separately from other names; I like this because I can quickly tell if anyone mentions me, and I can find my last tweet quickly.

Update: I've fixed the script to work with Twyt 0.7 (which is the version in Ubuntu 8.04) and 0.8 (which is currently the latest version). You can also now send updates to Twitter with it - just type them and hit enter, and they'll show up on the next refresh.


Tags: , , , ,
Comments (4)

Greasemonkey script: Pitchfork links

Last.fm links on Pitchfork I read a lot of record reviews over at Pitchfork, and when something sounds good, I usually jump over to Last.fm to listen to it, or to remind myself to check it out again later. For a long time, I've been meaning to write up a Greasemonkey script for Firefox to generate the Last.fm link for me, so I don't have to type it in every time. You know, because that's so hard.

Anyway, I'm working on an, ahem, not tremendously exciting project at work, so I finally got around to it. I went ahead and made it extensible for other links besides Last.fm, so it can do links to iLike and Wikipedia, too; others are easy to add if you're reasonably familiar with Javascript. The script adds the links right next to the album artwork, right below the links to Emusic, digg, del.icio.us, and so on.

I posted it on userscripts.org. I currently have a hundred or so back reviews to read, so hopefully I'll have saved net keystrokes by the time I catch up.

Update: added links to IsoHunt, Mininova, and the Pirate Bay, by request.  I can't test right now because I'm on Firefox 3 RC2 and Greasemonkey doesn't work there yet.  But you can get the new version right here for now.  I will update it on userscripts.org as soon as I get it tested.


Tags: , , , , , , , , , , ,
Comments (2)

Acquisitions

I just think it's really interesting that Oracle is buying BEA and Sun is buying MySQL, and that both acquisitions were announced on the same day.  That is all.


Tags: , , ,
Comments

Living the dream

Today I registered a new domain - mogrify.org - and began the process of migrating my websites to my new host, Dreamhost. The now-venerable mogrify.homelinux.org, as you may have noticed, redirects to the shiny new code.mogrify.org. I'll be moving other things across in the coming days and fixing problems whenever I notice them.

I've been wanting to host offsite for some time, since I'm currently running three separate sites on a single, beige Pentium III Dell box in my study. This is not exactly the most robust of setups, and there have been issues with power and network outages.

I expect to love Dreamhost for the same reason I love hosting at home - because I genuinely enjoy administering Linux systems, and Dreamhost gives you a lot of control - shell access, .htaccess files, log files, email accounts, etc., as well as a whole ton of other options.

So, the dream is becoming a reality.


Tags: , , , ,
Comments (1)

Update your status on Twitter and Facebook with Perl

Here's twitface, a Perl script I wrote to set my Twitter and/or Facebook status from the command line.

Get twitface Apparently this violates Facebook's TOS. Oh well.

I run it as twitter to update Twitter, fbstatus to update Facebook, and twitface to update both. To accomplish this, I keep it in my ~/bin directory, with symlinks to it called twitter and fbstatus. So:

cd ~/bin
ln -s twitface twitter
ln -s twitface fbstatus

You'll have to edit the script once to set your Twitter and Facebook login info, but after that, it's as easy as:

twitface wasting time on social networking websites.

Remember that Facebook prepends '[Name] is' to the status you set.

You can also use this to send direct messages via Twitter as you normally would; so this type of thing works as you'd expect:

twitter d rtm Remember the milk...

I found Christian Flickinger's PHP+cURL code quite useful while writing this, since it meant I didn't have to dissect Facebook.

I'm new to Twitter right now, but it seems pretty fun. We'll see how it goes.


Tags: , , , , ,
Comments (3)

Ceci n'est pas une pipe

Been playing with Yahoo! Pipes. I was intrigued by a Lifehacker post I saw a while back about creating your own master feed by pulling in feeds from around the web and squishing them together. So I did it.

My master feed now includes:

I also created a pipe for the posts by themselves, which I can use to import all of my posts into Facebook as notes (Facebook only imports items from one feed at a time). Kinda cool. I imagine there's more stuff out there to pull in, but it's a pretty good start.


Tags: , , , , , , , , , ,
Comments

FeedBurner

I'm trying out FeedBurner for the RSS feeds here. FB seems like an interesting service, so I just want to see what it's all about.

That is all.


Tags: , , ,
Comments

MyPlunge

Well, I finally took the plunge and joined MySpace. I was very reluctant… there's so much mediocrity on the web, and so much of it lives at MySpace. I have two initial thoughts:

  1. I've seen uglier HTML code in my life, but it was generated by Word 97; and
  2. I've seen more addictive activities in my life, but only in video games (Fallout! Tetris!) and psychoactive drugs.

You'd think that something that was designed to be personalized would have a few more CSS hooks. I managed to get the thing looking better with the help of Mike Industries' setup, which was nicely done, but jeez. When I have to write CSS rules for "table table table table td," something is very, very wrong. Would it kill them to add a few id and class attributes?

Well, it's painful, but I'll get over it. And my page will always be a safe haven from 600-pixel images, autoplaying music, animated GIFs, videos that all start playing at the same time, and high-contrast background images. Such atrocities will never be committed on my watch.


Tags: ,
Comments (1)

HenricoCrime.org

I recently put together a new website, HenricoCrime.org. It's a crime data/Google Maps mashup in the style of ChicagoCrime.org and RichmondCrime.org.

The crime data comes from the Henrico County, VA police department website… the heavy lifting is handled by a set of PHP classes that search the site and scrape the HTML for event data. I use Yahoo's geocoding service to find the latitude and longitude of each event. I first tried Google's but I found that it guessed wrongly too often… Henrico County has several different localities, and I have no way of knowing which one I'm looking for. Google will return hits on similar street names in the wrong places, where Yahoo is more strict. I then store the whole mess in a MySQL database on my server.

All that happens on the backend - the website itself just queries the database and assembles a Google Map with info markers for each event. I also generate some basic statistics from the database for each day.

The other interesting bit is The Cloud. I was trying to think of interesting ways to display trends over a long period of time… The Cloud loads hundreds of crime events at once and marks each one with a tiny, nearly transparent dot on the map. As events stack up in the same place, the marks become darker. So if you pull in a few thousand events, you can see where much of the police activity is happening. Generally, it seems like many of the events cluster along the main roads in suburban Richmond. The best places to be, crime-wise, appear to be Glen Allen (the area in the North right around 295), and eastern Henrico (which is mostly rural).

I'd like to keep coming up with different ways of looking at the data; for instance, weekly, monthly, and annual statistics, breakdowns by crime type, RSS feeds, etc. Most events have more data than I'm actually displaying here, so there should be some other possibilities.

Oh, and I also recently completed a site for my aunt, who runs Connections Speech-Language Therapy in Boerne, TX. So, shameless plug there.


Tags: , , , , , , , , , , ,
Comments (1)

Bad Behavior has blocked 53 access attempts in the last 7 days.