Thursday, September 13, 2012

test deleting blogs (2)



ADDITIONAL INFO (source code) here:

#!/usr/bin/env ruby
require 'rubygems'
require 'blogger'
require 'mechanize'
require 'set'
STDOUT.sync = true
gmail_url = 'http://www.gmail.com'
gmail_username = 'username'
gmail_password = 'password'
blogger_blog_id = '12345'
blogger_blog_name = 'blog_name'
blogger_id = '1234567890'
blogger_username = gmail_username
blogger_password = gmail_password
# log in to your gmail account
agent = Mechanize.new
page = agent.get gmail_url
form = page.forms.first
form.Email = gmail_username + '@gmail.com'
form.Passwd = gmail_password
page = agent.submit form
# get the list of ids as per google reader
reader_ids = Set.new
page = agent.get("http://www.google.com/reader/atom/feed/" +
  "http://#{blogger_blog_name}.blogspot.com/feeds/posts/default?r=n&n=100")
page.body.scan(/https\:\/\/blogger.googleusercontent.com\/tracker\/\d*\-(\d*)\?/).each do |id|
  reader_ids << id.to_s
end
# get the list of ids as per blogger
account = Blogger::Account.new(blogger_id, blogger_username, blogger_password)
if account.authenticated?
  blog = account.blog_for_id(blogger_blog_id)
  blog.posts.each do |post|
    reader_ids.delete(post.id)
  end
end
# the following posts have been deleted
reader_ids.each do |id|
  puts id
end

test deleting blogs (1)

check the complete info here! http://crsouza.blogspot.nl/2010/03/partial-least-squares-analysis-and.html

While I was working on my next article using Windows Live Writer, I've hit the "publish" button too soon and ended up with a published draft in my blog. I just went and re-drafted the entry, thinking everything was going to be fine. Unfortunately, I did not realize that Google Reader automatically caches everything it finds, and do not delete entries even if them have been deleted from their original blog.
After some researching, I've found out that if I published a new post with the same GUID as the unwanted entry, it would be automatically updated in Reader. So here are the steps to remove an unwanted blog post from Google Reader:

Removing an unwanted blog post from Google Reader

Step 1: Consulting Reader's cache

Type the following address in your address bar, substituting yourblogname by your actual blog name:
http://www.google.com/reader/atom/feed/http://yourblogname.blogspot.com/feeds/posts/default?r=n&n=100
Go to the page, then right click its content and select "View page source" or equivalent.

Step 2: Find the offending post

Find the string "blogger.googleusercontent.com/tracker/" and notice the two numbers that come after it:
https://blogger.googleusercontent.com/tracker/8842221210811726528-2876694319097447217?l=yourblog.blogspot.com
Those are your blog ID and post ID, respectively.

Step 3: Resurrection!

Copy and paste these two numbers in the placeholders of the following URL:
http://draft.blogger.com/post-edit.g?blogID=yourblogid&postID=yourpostid
Finally, open this URL and watch your once deleted (?) blog post be resurrected from the dead. Update it or just leave it blank, set the post date to the future and publish it again. VoilĂ !


yahahaha

hahahaha

second post

bleheheheh

first post

blah hahaha