But Ruby itself does not seem important here, though the code is given
below.
The feed URL of a blog looks like...
http://soichi-memos.blogspot.com/feeds/posts/default
or
http://www.blogger.com/feeds/8431963099352886303/posts/default
but the attempt to get URLs of entries gives only a portion of the
entire blog. (in this case only 25 of them)
Accessing these feed URLs gives XMLs containing only 25 entries, so I
am guessing that the problem is the setting of Blogger...?
But I am not sure.
Could anyone help me obtain ALL URLs of the blog?
#-------Ruby code starts here-----------------------------
require "rubygems"
require "open-uri"
require "nokogiri"
blog_feed = 'http://soichi-memos.blogspot.com/feeds/posts/default'
file = "list_url.txt"
filename = File.open(file, "w")
xml = Nokogiri::XML(open(blog_feed))
xml.search("link").each do |tag|
if tag.get_attribute("rel") == "alternate" then
url = tag.get_attribute('href')
filename.write(url)
filename.write("\n")
end
end
filename.close
#-------------Ruby code ends here
---------------------------------------
--
You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group.
To post to this group, send email to bloggerdev@googlegroups.com.
To unsubscribe from this group, send email to bloggerdev+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bloggerdev?hl=en.
No comments:
Post a Comment