Archive for the ‘Blogroll’ Category
I have finally got CURL to work with the new Google Beta (no longer BETA). I partly owe the problems to Google not putting up clear examples, and to a silly mistake in passing the Auth Token.
It then resulted in my finding a Vim-python plugin that actually works and beautifully. I also found that Google has released a Emacs plugin that uses curl. I studied it, but that did not solve my CURL script, since my script had a silly error. But from the Emacs project I have picked up an XSL that formats the feed beautifully to an HTML file.
So there was a lot of learning involved, till i found that I had grepped out the
"Auth=" string from what Google returns me, but NOT removed it. It should be
"auth=" in the other requests. Once that was fixed last night, all programs began running fine.
Then i brought together the various files (one for each process) and put it into one single file (blogger.sh) with functions, this way
authenticate is coded only once. I might add that the Java API is very complicated (yuck), it is a lot slower than the CURL program. Also, it requires a lot of code, so i cannot think of combining all Java programs into one. The command line would be too complicated to handle. So i learned about bash
getopts (very simple, unlike Java), and various other things.
So now we have one simple file that does the following:
- Post a given file to your new Blogger Account
- Delete a given URI from your new Blogger Account
- List out Titles and allow you to Delete a post based on title
- Dump the blog feed to an XML file. I also use xsltproc and the XSL mentioned above to create an easy-to-view HTML file
- Gives you a template for posting
Inputs: A user need only enter his Blog URL, and put his gmail account and password in a file.
All else is handled by the shell-script.I have also created Vim mappings so that the user may easily operate from within Vim. e.g.
- bbt – inserts a new template, placing cursor in title, and highlighting CONTENT section.
- bbp – post to Blogger
- bbv – View last 25 titles and delete any he choses
- bbh – help
I would like to create a program to take a file in Movable Type Format, and convert that to Gdata format and post it to Google Blogger. There are other facilities that can make this more IDE like. The posted file is returned by Google as an XML. We could use that for editing. Also, I could store the feed file-wise, or allow retrieval and let the user edit and post that.
Handling multiple blogs for one user.The source file
blogger.sh is posted here. At present, the blogname, user and password are read from
~/.bloggerrc in the following format: