Digg API Cocoa framework


I have been secretly preparing in my evil laboratory, a Cocoa framework that makes it ridiculously easy to use the recently-released Digg API.

A little sneak preview of some of the stuff you can do with it:

- (DiggObject *)fetchStoryWithID:(int)ID;
- (DiggObject *)fetchStoryWithTitle:(NSString *)name;
- (DiggObject *)fetchStoryWithURL:(NSString *)url;
- (NSMutableArray *)fetchStoriesForDomain:(NSString *)domain;
- (NSMutableArray *)fetchStoriesForTopic:(NSString *)topic;
- (NSMutableArray *)fetchStoriesForContainer:(NSString *)container;
- (NSMutableArray *)fetchStoriesSubmittedBy:(NSString *)user;
- (NSMutableArray *)fetchPopular;
- (NSMutableArray *)fetchRecent;
- (NSMutableArray *)fetchStories;
- (NSMutableArray *)fetchUpcoming;

It’s also just as easy to set the options or parameters that you would like to call the query with:

-(void)setAppkey:(NSString *)newAppkey;
-(NSString *)appkey;

-(NSString *)proxy;
-(void)setProxy:(NSString *)newProxy;

-(BOOL)single;
-(void)setSingle:(BOOL)newSingle;

-(int)count;
-(void)setCount:(int)newCount;

-(int)offset;
-(void)setOffset:(int)newOffset;

-(int)total;

-(NSString *)domain;
-(void)setDomain:(NSString *)newDomain;

-(NSString *)sortBy;
-(void)setSortBy:(NSString *)newSort;

-(NSString *)status;
- (void)setStatus:(NSString *)newStatus;

- (NSString *)minSubmitDate;
- (void)setMinSubmitDate:(NSString *)newMinSubmitDate;

- (NSString *)maxSubmitDate;
- (void)setMaxSubmitDate:(NSString *)newMaxSubmitDate;

- (NSString *)minPromoteDate;
- (void)setMinPromoteDate:(NSString *)newMinPromoteDate;

- (NSString *)maxPromoteDate;
- (void)setMaxPromoteDate:(NSString *)newMaxPromoteDate;

Currently the focus is on fetching stories, but fetching information for users, events (Diggs and comments), topics and containers will be written in shortly.

The only major thing lacking now is people to use the framework!

If you’re interested, drop a comment below and I’ll provide you with the necessary ammunition to create, fetch, parse and utilize Digg API calls with the ease of regular Objective-C Cocoa methods.

The official release date will depend on the response from the initial testers, so what are you waiting for? Ask me for a copy!


Back to Top ↑

20 Comments so far

Leave a comment
  1. 1

    Cool!

    I’d love to try it out.

  2. 2

    I’d also really like to give it a try !

  3. 3

    Nice, it will be interesting to see what people do with it.

    I’d like to try it out as well.

  4. 4

    What’s with the use of ‘get’-prefixed methods that don’t return values by reference - the valid use of ‘get’ in Cocoa methods? Is this a case of the API name fighting Cocoa conventions?

  5. 5

    Emailed the framework to David, Xavier and Carl…

    Jesper, I used the “get” prefix to indicate that a remote connection would be created. If that’s not the greatest thing to do, I’ll be happy to change it.

  6. 6

    It makes sense that there’s such a notation somewhere, but the get prefix in Cocoa specifically means and has always meant to return a value by pointer.

    Like, in NSData: - (void)getBytes:(void *)buffer

    How about using “fetch” instead of get? It doesn’t conflict with any standard prefix and to me it conveys that something’s going to be retrieved from somewhere far away.

  7. 7

    Ok, improvements are coming. Threading, parameters, delegation, and maybe some documentation.

    The get / fetch thing will be ‘fixed’ too.

    Still taking requests if anyone else wants a copy.

  8. 8

    Would love a copy please :)

  9. 9

    I’d love to mess around with that too!

  10. 10

    Emailed to iSlayer and Oriol.

    Updated quite a few things, but no threading / delegation yet, but a host of improvements, fixes and additions.

  11. 11

    would love to take a look at it. Just getting into tis sort of thing.

  12. 12

    Emailed!

  13. 13

    I’d love to try out the your digg Api Cocoa Framework. :)

  14. 14

    Mailed. I’ll try to get CURLHandle in sometime soon so the proxy is not needed.

  15. 15

    I would likewise like to try it out.

  16. 16

    Would love to try it out also!

  17. 17

    I found this page on Google and I’m really interested in trying out your framework. I gather it hasn’t been released yet; if so could you please mail me a copy? Thanks :)

  18. 18

    I’m trying to make a digg iPhone app, and this sounds perfect. Is this still available, and if so could I have a copy please?

    Thanks :)

  19. 19

    Unfortunately, I deleted the source for this project after realising it could be written more efficiently (Yes, I should have kept a copy… sorry). I will write it again when I get time, but that won’t be until next year.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Comments may be edited for formatting.