Blog

Filtering all blogs in category "Ruby."    Clear filter

Free Google Translate API v2 6

 Background

Google Translate API v2 is now available as a paid service only, and the number of requests your application can make per day is limited. As of December 1, 2011, Google Translate API v1 is no longer available; it was officially deprecated on May 26, 2011.

Migration
So, if you were using google translate API in you application, you have to register for a paid service or you may do like other many developers migrated to other free API services like

 

Wait, Google Translate API is still FREE :) Lets see how.

 

Read More

Rasem, draw SVG images using ruby1

The web is moving to HTML 5 where SVG images are the standard images to use. But how to generate SVG images to include? You might draw static SVG images and include them in your web site but this will not help with generated SVG images with dynamic data. Of course,  you can read the complete specification of SVG and generate your own images; these are a few hundreds of pages; good luck with that :)

The elegant solution is to use Rasem, a pure ruby gem, to generate SVG images. Rasem allows you to describe your SVG images in pure ruby code. You can either save the generated image to a file or output it to a string to use it with your HTML 5 page. Rasem generates standard SVG images that are compliant with the W3C standard.

gem install rasem

and have fun!

Checkout the project main page at: http://github.com/aseldawy/rasem

You can find examples and usage instructions there.

Read More

Creating a Mechanize redirects log1

In this post, we will see how to create a redirects log to mechanize library. Mechanize is following redirects, but what if I want to know which pages it visited? It is simple and easy to add redirects logs to mechanize.

Read More

Using Windows Live Contacts in Ruby1

You can use Windows Live SDK to get user contacts. To get start using this APIs you mush follow the following steps: 

  1. Register your application.

  2. Install and run the sample application for your platform.

  3. Request consent from the Windows Live ID user.

  4. Parse the consent token to obtain the delegation token.

  5. Use the delegation token to access an allowed offer and action. 

Read More