David Cook (davidcook) wrote,
David Cook

  • Mood:

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.

  • Books read in 2017 ...

    Angel of Storms - Trudi Canavan The Rhesus Chart - Charles Stross Magic for Nothing - Seanan McGuire The Annihilation Score - Charles Stross An…

  • DW and LJ

    In case anyone is looking for me on Dreamwidth, same username as on LJ (since, ummm ... 2009 !) Original post on Dreamwidth - there are…

  • Movies in 2015 ...

    Well, I'm cheating a bit, because I only saw one at the cinema, Star Wars: The Force Awakens, but I want to note down a few thoughts I had on it ...…

  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.