I use this AppleScript to upload entries to my 'blog. I've written and now maintain my own 'blog software, which supports both blogger API and MetaWeblog API, so the MWA version will be shortly forthcoming as well.
New versions will be found here, and you can stop by my 'Blog to see the results of this @ http://brad.globeproductions.com.au.
Have fun, and I hope someone finds this useful.
Cheers
PS - As the title of this post reads, this is NOT for the newer "atom" blogger API, rather it is for the original old school blogger API. I realize this limits the functionality of the script, but I wrote it for me :D
--
-- change blogServer, xmlApplication, username, and password to your server settings
set blogServer to "brad.globeproductions.com.au"
set xmlApplication to "/blogserv/xmlrpc.php"
set myUsername to "username"
set myPassword to "password"
set postURL to "http://" & blogServer & "/blogserv/entries/"
global blogServer
global xmlApplication
global myUsername
global myPassword
on getUserInfo()
set myApplication to "http://" & blogServer & xmlApplication
using terms from application "http://www.apple.com/placebo"
tell application myApplication
set retVal to ¬
call xmlrpc {method name:"blogger.getUserInfo", parameters:{myUsername, myPassword}}
end tell
end using terms from
return retVal
end getUserInfo
on newPost(content)
set appkey to "dummy"
set blogid to "dummy"
set myApplication to "http://" & blogServer & xmlApplication
using terms from application "http://www.apple.com/placebo"
tell application myApplication
set retVal to ¬
call xmlrpc {method name:"blogger.newPost", parameters:{appkey, blogid, myUsername, myPassword, content, 0}}
end tell
end using terms from
end newPost
tell application "WriteRoom"
set my_document to the document of window 1
set my_content to the text of my_document
set my_title to the name of my_document
set my_title to text ((offset of ":" in my_title) + 2) through (the length of my_title) of my_title
end tell
set wholeContent to ("" & my_title & "" & my_content)
set postID to newPost(wholeContent)
do shell script "open " & postURL & postID
| Attachment | Size |
|---|---|
| bloggerNewPost.zip - zipped version of the script | 4.23 KB |