?

Log in

No account? Create an account
Paperclips, string, and duct tape ... - He's just this guy, you know.

> Recent Entries
> Archive
> Friends
> Profile

Links
Schlock Mercenary
Something Positive
Megatokyo
Irregular Webcomic
Sluggy Freelance

September 14th, 2013


Previous Entry Share Next Entry
10:57 pm - Paperclips, string, and duct tape ...
Once upon a time, I knew some Chinese. Every now and then I poke at random resources on the Net that might help me remember some of what I once knew. A while back, I had the bright idea that if there were some Twitter accounts posting a few basic vocabulary words a day, I'd be able to pick some of them up over time and with luck, remember some.
I searched but didn't find anything existing that seemed suitable, and then I ran across the MDBG site, which has the usual Chinese dictionaries and things, but also has a page of feeds for the words in the HSK vocabulary lists (HSK is a standard test of Chinese level used in various places including China).
Bingo, I thought. ... but then, how to get them to Twitter ? Fortunately, there's a site around for just such a need, Twitterfeed.com.
So I created a feed there, hooked it up to a Twitter account, and to the MDBG HSK level 1 feed, and away it went, feeding me 10 random Chinese words a day from the list ... for a while.

There was a hitch, though. Every entry in the feed has an "id" field and a "link", and Twitterfeed runs duplicate checking which assumes those fields will be unique for a new entry.
The MDBG feed runs through the characters in the Level 1 list, and then repeats, and its "id" and "link" values are based on the URL linking to the word in their dictionary, and thus also repeat.
So after a month or so, the Twitter account dried up, and it took me a while to notice.

Eventually I did some tinkering in Ruby, and found that there were gems available for reading and parsing RSS feeds, and the "sinatra" gem provides a light-weight but useful web framework. 50-odd lines of code gives me a "web app" that reads in all of the MDBG feeds, adds the current date to the id field, and then waits for requests for the feeds. I run the app on Heroku - it's light enough that it can run on the free tier there.

... and it almost works. For some reason Twitterfeed only seems to be picking up the first entry from my feed, even though the only changes are the id and link fields to make them non-unique every day. One day I'll do more tinkering and try to work out why ...



Original post on Dreamwidth - there are comment count unavailable comments there.
Current Mood: geekygeeky

(En garde !)


> Go to Top
LiveJournal.com