Client c= new CommonsClient();where you can see a class by name GoogleLogin. Apparently, this seems obvious that its from google api, rest is abdera. Fine. So, i started to hunt for gdata api. Co-incidently or my bad luck (plus few others still shouting in google groups) the download link for gdata api zip file is broken(even now). I sent a urgent mail to my bosses. Even they tried and the same happened. Then i thought of asking my friend who is in US (online right now), Nitin, to download and mail me. (I got it just now). I was soo relieved that finally i got it till i found that the class is not in gdata. Then where is it? Going back to the post, i read it once again. Not the code, but the text != code. I read this line twice, thrice : "It's fairly simple to create a new post using the APP client in Apache Abdera.." to realise that abdera has some handy class to talk to google!! By that time Nitin came back to his office after getting some food n asked me if i got the file. I was in a not so happy mood as i screwed myself for a day. However i thanked him for that, coz i know how desperately i was looking for the library.
// Get the authentication token
GoogleLogin login =
new GoogleLogin(c, "blogger"," my@email.address","mypassword");
String auth = login.getAuth();
auth = "GoogleLogin " + auth;
// Create the entry that will be posted
Entry entry = Factory.INSTANCE.newEntry ();
entry.setId(FOMHelper.generateUuid());
entry.setUpdated(new Date());
entry.setTitle("Testing");
Ok... so where is the mistake? Mistake is :
Read the accompanied documents properly and expect the unexpected (like a cow sneezing mangoes/abdera having google login support)
Will sleep now. Its 2:06am. No, will post this from my atom client!! WOW!! Great idea. Wait....
Update: I was not able to use the abdera to talk to google. Had to use gdata. It works fine. Tested it yesterday night. It was good to see things working.
--
regards/Yogesh
1 comment:
Sorry to hear to had problems posting to blogger beta with the Abdera code. I've tested it many times without any problems. There are a few gotchas, however. The most significant is that Gdata/Blogger requires that posts specify a Content-Length header on the request. By default Abdera excludes the header to avoid having to buffer the input to calculate the size. There is a RequestOption to disable chunking in the request. Anyway, feel free to post a note to the Abdera-use mailing list with the code you were trying to get working
Post a Comment