Pulling RSS Feeds Through a Translator

From JoatWiki
Jump to: navigation, search

(28 Oct 2006) It appears that you can pull RSS feeds through translators prior to aggregating them. As an example, I've pulled the Yandex Security feed through a translator so that I can aggregate it with Bloglines. Here's the new url:

http://fets5.freetranslation.com/?sequence=core&language=Russian/English&url=http://news.yandex.ru/security.rss

Of course, there are drawbacks:
  • Something is always lost in the translation (example: 'Safety' when they meant 'Security').
  • Your reading is limited to the translated end-product so unless you can come up with a way to modify the links in the feed, the technique is limited to full post feeds.

In any case, it adds a new facet to available information.

(21 Mar 2010) Note: the above no longer works. Neither does Google Translate, FreeTranslation, or Bablefish (directly). This is mostly because the translators no longer handle raw data. They require specifically formatted input, which an RSS feed doesn't meet.

This isn't to say that it can't be done. It can. I've used Google Translate and Yahoo Pipes to pull in a tranlation of Yandex News. (I'm thinking that this can also be done with other mashup tool sets.) I'm a complete novice when it comes to working with Pipes but I was able to look at other people's pipes and piece together a feed translator which also fixes the links in the feed so that they too will be pushed through Google Translate when they're clicked. There's probably a better way to do the third loop but it works. Explanation is below.

russian_pipes.png

!! Steps

1) Get an account at Yahoo Pipes

2) (Optional) Watch the tutorial

3) Login to Pipes and click on "Create a Pipe" (top of the page). This opens a work space for your pipe.

4) In the left-hand menu, click on "User inputs" and then drag & drop "Url input" onto the work space.

pipes-url-input.png

5) In the Url-input box:

  • set "Name" equal to "RSS"
  • set "Prompt" equal to "RSS"
  • enter your source url in the box for "Default"
  • leave "Position" and "Debug" empty

6) In the left-hand menu, click on sources and drag & drop "Fetch Feed" onto your work space.

pipes-fetch-feed.png

7) Note the faint circle to the left of the entry field in the "Fetch Feed" box. Using your mouse, click and hold on the circle at the bottom of the "RSS (url)" box, and drag it to the faint circle at the right of the entry box in "Fetch Feed". The entry field should gray out, containing the words "url [wired]".

8) In the left-hand menu, click on "Operators", then drag and drop a "Loop" onto your work space.

pipes-empty-loop1.png

9) In the left-hand menu, click on "String", then drag and drop "Translate" into the space in the Loop box where it says "Drop module/pipe from toolbox here".

10) In the "Translate" box that you just dropped, there's a drop-down menu entitled "- Select from and to languages -". Click on that and select the appropriate option.

11) In the recently dropped "Loop" box, it should say "For each 'item:title' in input feed. If it doesn't, click on the box and select "item.title".

12) At the bottom of the "Loop" window, select the radio button for "assign results to" and then click in the box to the right of that. Select "item.link" as you did in the step above.

13) Click and hold the circle at the bottom-middle of the "Fetch Feed" window and drag it to the circle at the top-middle of the "Loop" window.

pipes-loop1-done.png

What you've done so far is effective grabbed a feed, parsed it for story titles, and had Google translate them from Russian to English. To translate the story bodies and ensure that any link clicked in a story gets translated, you'll need two more "Loops".

14) In the left-hand menu, click on "Operators" and drag another "Loop" object into your work space.

15) In the left-hand menu, click on "String" and drag another "Translate" into this second "Loop" box. Make the configuration for the "Loop" and "Translate" look the your previous one, except: select "item.description" vice "item.title".

16) In the left-hand menu, click on "Operators" and drag another "Loop" object into your work space.

17) Using the previous method, connect the bottom of your first "Loop" window to the top of your second "Loop" window. Then connect the bottom of your second "Loop" window to the top of your third "Loop" window.

18) In the left-hand menu, from the "String" sub-category, drag "String Regex" into your third "Loop" box.

19) Inside of the "String Regex" box, the "replace" field should contain "^(http://.*)" and the "with" field should contain:

http://translate.googleusercontent.com/translate_c?hl=en&ie=UTF-8&sl=ru&tl=en&u=$1

20) Connect the bottom of this third "Loop" window to the "Pipe Output" window.

russian_pipes.png

21) Click on "Save" (top of the screen) and then click on "Run Pipe" (top center).

22) A new window should open. Give the Pipe a chance to load (be patient). Once it loads, you can read the news entries. You should also see the usual badges for subscribing to the new RSS feed. Enjoy!

russian-pipes-done.png

Personal tools