API for Comments

darryldarryl Registered Users Posts: 997 Major grins
Hey -- are you guys ever gonna provide a hook into comments? If you aren't going to support [thread=73349]Keywords editing for site-wide passwords or private passwords[/thread], then I was thinking maybe I could write a quick hack that periodically appends comments to existing Keywords.

Since it's password-protected and I'll be telling everybody to just use Comments for user-submitted keywords, I think I'd be safe from spammers, etc.

But alas, no API for comments. Hrm, do mail notifications of comments include the photo ID and actual comment (I'm thinking procmail + php)?

Hackish. Please don't make me hack too badly.

--Darryl

Comments

  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited October 11, 2007
    G'day Darryl,

    It's something we may do for 1.2.1, retrieving comments should be pretty easy, but I will have to think through the issues around adding comments.

    As for the comments email, it has a link to the SmugMug image, so you could retrieve the image id, but the comment isn't included.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • darryldarryl Registered Users Posts: 997 Major grins
    edited October 11, 2007
    Yah, I saw the link in a test comment I made. Good to hear you're thinking about adding it. I don't relish trying to screen scrape considering that comments are "hidden" in Javascript and I'll have to go through some gyrations to make Smugmug think that curl or LWP is a real web browser. :P

    --Darryl
  • darryldarryl Registered Users Posts: 997 Major grins
    edited October 15, 2007
    Once again, RSS to the rescue!

    From here: http://smugmug.jot.com/WikiHome/Customization/FeedsTricks

    http://[nickname].smugmug.com/hack/feed.mg?Type=usercomments&Data=[nickname]&AuthKey=hhXia.&format=rss200

    The AuthKey isn't actually required.

    One little nit: The comments tag doesn't actually take you to the "comments page" for the item. It seems like technically, this should be the same page as the photo itself, since SmugMug doesn't have separate comments pages for photos (unlike say, blog entries).
       <item>
         <title>Guest commented on G &amp; D's photo</title>
         <link>http://gladlee.smugmug.com/gallery/1865178/1/93737758/Medium#comment</link>
         <description>&lt;p&gt;Guest commented on G &amp; D's photo: &lt;a href=&quot;http://gladlee.smugmug.com/gallery/1865178/1/93737758/Medium#comment&quot; title=&quot;Guest commented on G &amp; D's photo&quot;&gt;&lt;img src=&quot;http://gladlee.smugmug.com/photos/93737758-S.jpg&quot; width=&quot;200&quot; height=&quot;300&quot; alt=&quot;Guest commented on G &amp; D's photo&quot; title=&quot;Guest commented on G &amp; D's photo&quot; style=&quot;border: 1px solid #000000;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Rating: 0 stars&lt;/p&gt;&lt;p&gt;Comment: Nice perspective. Your focus is, um, needle sharp.&lt;/p&gt;</description>
         <category>Travel</category>
         <comments>http://gladlee.smugmug.com/comment.mg?Type=Image&amp;TypeID=93737758</comments>
         <pubDate>Thu, 14 Sep 2006 14:47:18 -0700</pubDate>
         <author>feeds-nobody@smugmug.com (G &amp; D)</author>
         <guid isPermaLink="false">smugmug:comment:574384</guid>
         
        </item>
    
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited October 15, 2007
    Darryl,

    you will see that the comments element is standard across all rss feeds, it's the url where someone can post a comment on the given image or album.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • darryldarryl Registered Users Posts: 997 Major grins
    edited October 15, 2007
    devbobo wrote:
    Darryl,

    you will see that the comments element is standard across all rss feeds, it's the url where someone can post a comment on the given image or album.

    Cheers,

    David

    Hi David:

    Right, but for the Comments feed, it points to a non-functioning URL.

    --Darryl
  • darryldarryl Registered Users Posts: 997 Major grins
    edited October 15, 2007
    lastBuildDate for usercomments RSS is not correct
    Hi, hitting this feed:

    http://gladlee.smugmug.com/hack/feed.mg?Type=usercomments&Data=gladlee&format=rss200

    I get:

    <lastBuildDate>Mon, 15 Oct 2007 19:09:34 -0700</lastBuildDate>

    (Timestamp of when I hit the feed.)

    However the most recent comment is from:

    <pubDate>Sun, 14 Oct 2007 22:46:55 -0700</pubDate>

    Shouldn't lastBuildDate reflect the last time a comment was made, like how it works with the Recent Galleries feed?
Sign In or Register to comment.