Pushing Buddy Updates via JavaScript

Here is the JavaScript edition of my previous post:

function SafePushTestFeed(session)
{
    try {
        manager = session.buddyFeedManager;
        myitem = manager.createBuddyFeed();
        myitem.feedTitle = 'Feed Title';
        myitem.feedLink = 'Feed Link';
        myitem.feedDescription = 'Feed Description'; 
        myitem.feedPublisher = 'Feed Publisher'; 
        myitem.itemTitle = 'Item Title';
        myitem.itemLink = 'Item Link';
        myitem.itemDescription = 'Item Description'; 
        myitem.itemGuid = 'Item Guid';
        myitem.itemCategory = 'Item Category';
        manager.push(myitem);
    }
    catch ( e ) 
    {
        // You can look this number up in the 
        // CoreWitness Symbol Lookup Dialog
        trace("Exception HRESULT=" + e.number);
    }
}

The buddyFeedManager is a property of the IAccSession interface. In C++ you access properties via the get_Property(prop, value) or get_XXX methods. However, from JavaScript you can access any property including the AccXXXProp_ ones by just using the property’s trailing name (everything after the AccXXXProp_ or get_). Property and method names are not case sensitive in JavaScript.

You can read more about the these interfaces by searching for the interface reference pages on IAccBuddyFeed and IAccBuddyFeedManager.

Tags: , , ,

Comments are closed.