[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Question on OpenURI

Srijayanth Sridhar

5/27/2008 4:39:00 AM

Hello,

For the following piece of code:

#! /usr/bin/ruby

require 'open-uri'
require 'rexml/document'
require 'rexml/xpath'

doc1 = open("http://www.cricinfo.com/rss/livescores...)
puts doc1.class

doc2 = open("http://ws.audioscrobbler.com/1.0/artist/Autechre/toptags...)
puts doc2.class


I get the following output:

moonwolf@trantor:~/ruby/lastfm$ ./scrape.rb
StringIO
Tempfile

The question I have is why openuri treats two similar entities as two
different classes?

Thank you,

Jayanth

2 Answers

Dave Thomas

5/27/2008 4:48:00 AM

0


On May 26, 2008, at 11:38 PM, Srijayanth Sridhar wrote:

>
> moonwolf@trantor:~/ruby/lastfm$ ./scrape.rb
> StringIO
> Tempfile
>
> The question I have is why openuri treats two similar entities as two
> different classes?


How big is the second one?



Srijayanth Sridhar

5/27/2008 4:51:00 AM

0

>>
>> The question I have is why openuri treats two similar entities as two
>> different classes?
>
>
> How big is the second one?
>
>
>
>


Large.

Thanks. That was it.

Jayanth