Random Numbers via YQL

| | Comments (1)

I recently discovered a very cool random number generator site appropriately called Random.org. After poking around a bit at the various generators available on the site, I discovered they also have a simple “http service” and sample client apps which use it.

As a quick exercise, I made custom data tables to access these random number services via YQL, Yahoo’s “select * from internet” service. To use these services in YQL, you’ll need to include the custom tables I created, then “select” some random numbers.

For example, to request a few random numbers (try it in YQL Console):

use "http://scooterlabs.com/yql/random.integers.xml";
select * from random.integers 
  where num="10" and min="1" and max="1000";

To request a random sequence, where every number in the range is used once (try it in YQL Console):

use "http://scooterlabs.com/yql/random.sequences.xml";
select * from random.sequences 
  where min="10" and max="19";

To generate some random strings (try it in YQL Console):

use "http://scooterlabs.com/yql/random.strings.xml";
select * from random.strings 
  where num="10" and len="20";

For a full description of each service, and more optional parameters, refer to the Random.org HTTP interface description.

Update 2010-02-25: I heard back from the owner of the Random.org site who said he has been blocking all Yahoo! Pipes traffic. So, this YQL query may stop working at some point.

Possibly related posts:

1 Comments

Unlike Pipes, YQL sends the IP address from the original request instead of a yahoo IP, so random.org can more easily block abusers without having to block all Yahoo developers. YQL still works right now, hopefully it stays that way.

About

This is the personal website of Brian Cantoni. All opinions on this site are my own.

Twitter

Delicious Links

This weblog is licensed under a Creative Commons License.

Tweetfave

Coming soon - a new way to get the most out of your Twitter Favorites: Tweetfave.com

Mobile Websites

Visit cantoni.mobi for a helpful list of mobile sites.

Advertising

Archives

For older entries, please refer to the Archives.