Tips - Publish.com
Publish.com Ziff-Davis Enterprise  
SEARCH · ONLINE MEDIA · MOBILE · WEB DESIGN · GRAPHICS TOOLS · PRINTING · PHOTO · TIPS · OPINIONS
Home arrow Tips arrow Building a Blogging Widget in Tiger
Building a Blogging Widget in Tiger
By Sean Gallagher

Rate This Article:
Add This Article To:
Tip: Eager to take advantage of Dashboard, Sean Gallagher has begun building a widget to serve as a client for Blogger API, and he explains how he got started.

Now that I've got Dashboard, I want to use it for something I do every day: blogging. So, I'm working on creating a widget that acts as a simple client for the Blogger API.

OK, so before all the bloggers out there get all fundamentalist on me, I want to explain why I'm using the Blogger API instead of something more au courant like Atom, or even the MetaWeblogAPI: It's no-brain simple. Since I'm trying to fit it on a widget-sized interface, I wanted to go with the most simplified way possible of getting content onto a remote Weblog.

But first, I needed to build the posting functionality behind the widget. So I took a quick side trip off to AppleScript land to do a proof of concept script.

AppleScript supports XML-RPC and SOAP calls, so it's a nice tool for throwing together a simple piece of RPC functionality.

It's important to note here that AppleScript is not a direct component of the Dashboard widget architecture. Widgets are all HTML, CSS and JavaScript. But being as I'm only slightly more proficient in making RPC calls using JavaScript than I am in Swahili, I figured that I'd work toward my strengths and use folder events, AppleScript and the new Automator scripting tool in Tiger, to cheat a little. So my plan is to create a widget that writes a text file to a "buffer" folder, and then use a folder event to trigger the actual posting of the content to a Weblog.

The Blogger API calls for:

  • An "appkey," which Blogger used to use as a licensing mechanism to regulate which applications could directly interface to Blogger (there's now a generic key, 0123456789ABCDEF) ;
  • Your blog ID number on Blogger (the number that's part of the URL for your Web interface to a Blogger Weblog—for example, if you log into Blogger and go to create a post, and the post creation page has a URL of http://www.blogger.com/post-create.g?blogID=12345678, your blog ID number is 12345678);
  • Your Blogger username;
  • Your Blogger password;
  • The contents of your post; and
  • A boolean parameter to tell Blogger whether to publish the post right away or not.
Here's the really poorly formatted script I wrote to test the interface:
set myappkey to "0123456789ABCDEF"
set myblogid to "(the id number of your Blogger blog)"
set myusername to "your Blogger username"
set mypword to "your password"
set mypost to "This is a test blog entry using an Applescript XML-RPC call, which will be incorporated into my blogging widget."
set mypublish to true

tell application "http://plant.blogger.com/api/RPC2"
	return call xmlrpc {method name:"blogger.newPost", parameters:{myappkey, myblogid, myusername, mypword, mypost, true}} 
		
	
end tell

The script sends the Blogger API interface call, and returns a number that uniquely identifies the post (which is visible in the "Result" window of the AppleScript editor window).

OK, there's no error-handling yet. And the post itself, as you can see, is hardwired in the script. But it's a start, right?

This item originally appeared in Sean Gallagher's Weblog, Root Access.


Discuss Building a Blogging Widget in Tiger
 
>>> Be the FIRST to comment on this article!
 

 
 
>>> More Tips Articles          >>> More By Sean Gallagher
 


Buyer's Guide
Explore hundreds of products in our Publish.com Buyer's Guide.
Web design
Content management
Graphics Software
Streaming Media
Video
Digital photography
Stock photography
Web development
View all >

ADVERTISEMENT


FREE ZIFF DAVIS ENTERPRISE ESEMINARS AT ESEMINARSLIVE.COM
  • Dec 10, 4 p.m. ET
    Eliminate the Drawbacks of Traditional Backup/Replication for Linux
    with Michael Krieger. Sponsored by InMage
  • Dec 11, 1 p.m. ET
    Data Modeling and Metadata Management with PowerDesigner
    with Joel Shore. Sponsored by Sybase
  • Dec 12, 12 p.m. ET
    Closing the IT Business Gap: Monitoring the End-User Experience
    with Michael Krieger. Sponsored by Compuware
  • Dec 12, 2 p.m. ET
    Enabling IT Consolidation
    with Michael Krieger. Sponsored by Riverbed & VMWare
  • VTS
    Join us on Dec. 19 for Discovering Value in Stored Data & Reducing Business Risk. Join this interactive day-long event to learn how your enterprise can cost-effectively manage stored data while keeping it secure, compliant and accessible. Disorganized storage can prevent your enterprise from extracting the maximum value from information assets. Learn how to organize enterprise data so vital information assets can help your business thrive. Explore policies, strategies and tactics from creation through deletion. Attend live or on-demand with complimentary registration!
    FEATURED CONTENT
    IT LINK DISCUSSION - MIGRATION
    A Windows Vista® migration introduces new and unique challenges to any IT organization. It's important to understand early on whether your systems, hardware, applications and end users are ready for the transition.
    Join the discussion today!



    .NAME Charging For Whois
    Whois has always been a free service, but the .NAME registry is trying to change that.
    Read More >>

    Sponsored by Ziff Davis Enterprise Group

    NEW FROM ZIFF DAVIS ENTERPRISE


    Delivering the latest technology news & reviews straight to your handheld device

    Now you can get the latest technology news & reviews from the trusted editors of eWEEK.com on your handheld device
    mobile.eWEEK.com

     


    RSS 2.0 Feed


    internet
    rss graphic Publish.com
    rss graphic Google Watch

    Video Interviews


    streaming video
    Designing Apps for Usability
    DevSource interviews usability pundit Dr. Jakob Nielsen on everything from the proper attitude for programmers to the importance of prototyping in design to the reasons why PDF, Flash and local search engines can hurt more than they help.
    ADVERTISEMENT