Ruby, Ruby on Rails, Artificial Intelligence and something more ...

Ver y Cocinar, descubre la cocina y disfrútala a simple vista

RailsConf Europe 2007 Speaker

RailsConf Europe 2007 Speaker
http://www.railsconfeurope.com/

Spejman Thumblog!

Monday 14 May 2007

Backup of Bloglines keep new items

If you are a Bloglines user, you probably save the interesting posts using "keep new" feature.

If you have use this reader for a time, the quantity of post saved could be large... Some day I thought that won't be funny to loose all this data, then I build a ruby script to backup bloglines "keep new" items into a xml file.

With this script I learned better Mechanize and Hpricot Ruby libraries.
Este script me ha servido para probar dos librerías muy útiles de Ruby: mechanize y hpricot.

You need these libraries in order to use the script:


gem install json
gem install activesupport
gem install hpricot
gem install mechanize


And here you have the script. I think is very understandable. I hope it helps you to backup your bloglines account (remember to change EMAIL and PASSWORD values with yours) or to understand better how mechanize and hpricot works.

require "rubygems"
require "hpricot"
require "json"
require "mechanize"
require "active_support"

# Reads a bloglines javascript tree structure that has all
# feeds data.
def read_tree( tree_base, label = "" )
tree_base.each do |tree|
if tree["kids"]
read_tree tree["kids"], label + "/" + tree["n"]
else
@feeds << [tree["n"], label, tree["kn"], "http://www.bloglines.com/myblogs_display?sub=#{tree["id"]}&site=#{tree["sid"]}"]
end
end
end

# Add more memory to hpricot otherwise couldn't load some webs.
Hpricot.buffer_size = 262144

agent = WWW::Mechanize.new
page = agent.get 'http://www.bloglines.com/login'

form = page.forms[1]
form.email = 'EMAIL'
form.password = 'PASSWORD'

page = agent.submit form

# Get the bloglines sindicated feeds
menu_page = agent.get "http://www.bloglines.com/myblogs_subs"
start_text = "var initTreeData = "
end_text = "\n;\n"
js_feeds_tree_str = menu_page.content[menu_page.content.index(start_text)+start_text.size..menu_page.content.index(end_text)]
feeds_tree = JSON.parse js_feeds_tree_str.gsub("\\","")
@feeds = []
read_tree(feeds_tree["kids"])

puts "<bloglines_saves>"
@feeds.each do |feed|

page = agent.get feed[3]
doc= Hpricot(page.content)

# get the content of all saved feed posts
content = ((doc/"body")/"td.article")
next if content.empty?
puts "<feed name=\"#{feed[0].strip}\" folder=\"#{feed[1].strip}\">"

# Iterate each saved feed post
((doc/"body")/"a.bl_itemtitle").each_with_index do |title, index|
puts "<feed_save title=\"#{title.inner_html.strip}\" href=\"#{title.attributes["href"]}\">"
puts content[index].inner_html.to_xs
puts "</feed_save>"
end
puts "</feed>"

end
puts "</bloglines_saves>"

Más información:

33 comments:

Pierre said...

Thanks, great solution, works like a charm!

mikehedge said...

I want to export my "keep New" items from Bloglines.

what do I do? do I install Ruby?

Anonymous said...

You can install McAfee online in 3 simple steps:
1.Goto mcafee.com/activate
2.Enter your 25 digits serail/key number
3.get protected

If you still face any problem you can call our toll free or chat with us.we are 24/7 helpline.


mcafee.com/activate Install & set-up

https://www.mcafee-serial-activate.com

Download Alexa App said...

Do you know you can play games with your echo device with echo buttons? Yes, that's true. You can play games with echo dot. There are so many games available.
For echo dot setup or other information related to echo devices visit here https://www.downloadappalexaecho.com

You can visit us at alexa.amazon.com and can also call us at our toll-free +1-888-381-1555

echo dot setup
amazon alexa setup
amazon alexa app
amazon echo dot
amazon alexa setup
alexa app
alexa setup
echo dot
http://alexa.amazon.com
http.//alexa.amazon.com
https://alexa.amazon.com

settingupamazondot said...

With the Echo Dot, You can ask for music, news, weather report, to book ola cab, get information and many more to get complete information and get Complete Alexa Setup to visit alexa.amazon.com. For Instant, help call at toll-free no. +1-888-745-1666.
Download Alexa App
https//alexa.amazon.com
http //alexa.amazon.com download
Amazon Alexa Setup
Echo Dot Setup
Alexa Download
Echo Setup
alexa.amazon.com
Alexa Setup
Alexa App

Alexa Amazon App said...

Now one can download books from kindle cloud reader by downloading kindle clouder app

Kindleforpc
Kindle app for pc
kindle reader for pc
download kindle for pc
amazon kindle for pc
kindle setup
kindle registration

Alexa Amazon App said...

Kindle for PC is that the most desirable editions of Windows seven through ten, Windows XP even windows ninety-eight. Kindle app for Pc and laptop has all access to any or all styles of books.it's a touchscreen friendly app for kindle reader for Pc users. The net association is needed to transfer the books from Kindle thus it should be quick because it might be WI-FI or 3G association on download Kindle for Pc.

Kindleforpc
Kindle app for pc
kindle reader for pc
download kindle for pc
kindle reader

Anonymous said...

Your post is very helpful and reliable. I am satisfied with your post. Thanks for sharing.
Office.com/Myaccount

Alexa Amazon App said...

You can customize your Alexa app by listing the device. open the app in your phone and then tap customize for doing the same. Choose the device which you want to customize by clicking on settings.

Alexa.Amazon.com
Alexa app
Echo setup
EchoDot setup

office setup said...

Thanks for this blog. It is really helpfull.
office.com/setup
office setup

sara mohamed said...

شركة نقل عفش من جدة الى بيشة
شركة نقل عفش من جدة الى محايل عسير
شركة نقل عفش من جدة الى جازان
شركة نقل عفش من جدة الى الباحة
شركة نقل عفش واثاث من جدة الى حائل
شركة نقل عفش واثاث من جدة الي الرياض
شركة نقل عفش من جدة الى الدمام
نقل عفش من جده الى القطيف
نقل عفش من جده الى جازان







Comfort Finds said...

There are a lot of people who suffer from edema, diabetes, sensitive skin, swollen and tired feet. In order to deal with these issues, they have to take extra care of their feet and wear footwear that are super comfy and don’t irritate their sensitive skin at all. There are specially designed shoes featured in the edema footwear collection of Comfort Finds.

MYSITE said...

Alexa app
The advancement in technology has flooded the market with incredible innovations and Alexa App for Echo Setup is a part of it which has become popular in a very shorty. Based on the voice commands, Echo App allows users to perform different functions and tasks.

Anonymous said...

office.com/setup: Setup and Install Office on your devices with Office website and product key to get all the features of Office 365/2020.

Black Grape Varieties said...

The best quality seedless grapes at the best price. Australias most popular fresh grapes delivered direct to you. Just call to order now +61 438 264 295 or +61 419 153 245

Clearpro Construction Water Solutions said...

Water Treatment Systems Brisbane:- Clearpro is a specialist in providing solutions and process systems for the treatment of water. Our highly professional team has great experience in the industrial water treatment process.

caremcafee said...

Find your Office product key & enter it on www.office.com/setup. After downloading, proceed to install and activate the Office setup.

Alisha Roy Mumbai Escorts Call Girl said...

On the off chance that you are searching for an escort agency, let us make you sure that you have arrived at your objective. Jalandhar escorts service offers prominent consider young escorts in Punjab and covers every one of the significant urban communities of the district. This data has a place with the escort agency in Ludhiana that is more well known among the delight searchers. In the event that you are looking for somebody who could be in your arms this evening so we can help you a great deal. Our escorts agency offers a scope of enchanting and flawless consider young ladies in Ludhiana those can be employed for any reason including actual delight. Allow us to illuminate about certain highlights about the best escort service in Ludhiana. All things considered, you can designate prominent escort service from here those are master on the whole the known types of lovemaking. You can either pick an autonomous escort to play you or let a develop woman satisfy your desire.

Ludhiana Escorts Service | Indore Escorts Service | Barmer Escorts Service | Ajmer Escorts Service | Visakhapatnam Escorts Service

Shoaib Amin said...

Hi! I love your writing! in the connection, we keep another contact
about your article on AOL? I need an expert in this field to solve my problems.
Maybe you are! I look forward to seeing you.
window product key
outbyte pc repair crack
icecream screen recorder crack
avast premier crack license key

Junaid Khan said...

I have to say I am impressed. I rarely come across such an informative and interesting blog,
and let me tell you that you nailed it
head A problem is something that very few men and women talk about intelligently.
I'm so glad I found myself in this quest for something
about that.
moho pro crack serial key
iobit malware fighter crack

sophiyadaniel said...

Amazon Prime video allows clients to download videos in three different formats, such as SD, HD, or 4k Ultra HD. Clients can then download the video according to their preference.
primevideo/mytv enter code
amazon.com/code
www.amazon.com/mytv
www.amazon.com/mytv login
primevideo/mytv enter code

sophiyadaniel said...

www.amazon.com/mytv: Enter the amazon activation code/amazon myTV code shown on your smart TV screen at Amzaon.com/mytv to register your compatible device with Amazon Prime. Enjoy unlimited movies and other web shows.
www.amazon.com/mytv enter code
www.amazon.com/code
amazon/mytv
roku.com/link
tubi.tv/activate

sophiyadaniel said...

It is important to remember that Amazon Prime Video is not compatible with every streaming device. Perhaps this is due to the fact that Amazon Prime Video is still relatively new. The service is still available on many devices.
espn.com/activate
amazon/mytv
amazon.com/redeem
amazon.com/redeem
xfinity.com/authorize

sophiyadaniel said...

Sign-in to your Roku with your Amazon username, password, or a code that you have received from Amazon. You will receive a code to enter when you register on Amazon.Amazon.com/mytv. The code will be automatically entered by the Roku channel to log you in to your account.
amazon.com/code
amazon.com/mytv enter code
amazon.com/mytv login

Unknown said...

Concern Info Tech is the Top SEO company in Chennai. We provide best SEO services for all kind of business.

alexmalcova said...

Amazon is one the largest multinational companies worldwide that contributes to technological advancements and makes people's lives easier. Amazon is not only the largest online retailer, but it has also been recognized as a leader in multinational technology around the world. Amazon offers a wide range of technological devices including the Echo Dot and Fire TV, as well as Cloud Cam, Kindle, Fire TV, Fire TV, and Fire TV. It also offers entertainment services such as Prime Video, Music Unlimited and Amazon Digital Game Store.
espn.com/activate
netflix.com/activate
netflix.com/activate
Xfinity.com/authorize
Xfinity.com/authorize

alexmalcova said...

You can now generate the Prime Video verification code for your Roku TV by following the instructions in this write-up. You can also register your device viawww.amazon.com/mytv.The steps in the blog's procedures are simple. If you have any questions, please contact Amazon customer service.
Primevideo/mytv
Primevideo/mytv enter code
amazon.ca/redeem
primevideo.com/mytv
Primevideo/mytv

Web Blogger said...

I enjoyed your post, however, I was curious if you could write for me.
Is there anything else to say about this? I'd be grateful if you could explain this to me.
iobit malware fighter crack
windows 7 home basic crack
windows 10 education crack
windows 7 professional crack

Unknown said...

You heard it correctly. Amazon Prime Video can be viewed on a gaming console. These are the steps you need to follow:
Yahoo mail login
Best Buy Gift Card Balance
appstore.com/redeem
Walmart Gift Card Balance Check
ebay gift card balance

Unknown said...

We already stated that you don’t need any additional contraptions to be successful.Watch Amazon Prime VideoIf you have a streaming device. You can watch Amazon Prime Video on the Streaming device by following these simple and quick steps:
roblox redeem code
Microsoft.com/redeem
Redeem your gift
ebay gift card balance
Roblox redeem code

Unknown said...

Amazon Prime video allows clients to download videos in three different formats, such as SD, HD, or 4k Ultra HD. Clients can then download the video according to their preference.
amazon.com/code
primevideo/mytv
vanilla gift card balance

Unknown said...

Users can stream the best online movies and shows via streaming.www.amazon.com/mytvAccount. If a user does not have an account they will need to create one and complete the activation process. All users are advised to read this information regarding how to activate and create an account on
PayPal Login
eBay Customer Service
netflix.com/activate
netflix.com/activate

Nikfury said...

Fantastic blog! What advise do you give for aspiring writers?
I plan to create my profile soon, however I am a bit
lost in total. Would you propose starting with
a free platform like WordPress, or should you go for the premium option?
There are so many alternatives that I am absolutely overwhelmed.
Any recommendations? Many thanks!
easeus mobisaver crack
easeus mobisaver crack
freemake video converter crack

About Me

Barcelona, Barcelona, Spain