Matt Gemmell

TOLL is available now!

An action-thriller novel — book 2 in the KESTREL series.

★★★★★ — Amazon

MGTwitterEngine updated

development & source 1 min read

This afternoon I found some time to update MGTwitterEngine, so it now offers the new API methods which were added by Twitter in April this year, specifically those listed below.

/* Get the current number of allowed API requests per hour. Calling this method does not count against the limit. */
- (NSString *)getRateLimitStatus;

/* Set your "location" (as shown in your profile, and returned via API methods in user data). This is just a string. */
- (NSString *)setLocation:(NSString *)location;

/* Choose the delivery method for any notifications you've enabled; can be "im", "sms" or "none". Passing nil or an empty string also means "none". */
- (NSString *)setNotificationsDeliveryMethod:(NSString *)method;

/* Block the specified user. */
- (NSString *)block:(NSString *)username;

/* Unblock the specified user. */
- (NSString *)unblock:(NSString *)username;

/* Perform a simple check to see if Twitter is up. */
- (NSString *)testService;

/* Returns the text shown on the Twitter site if there's any upcoming scheduled downtime, in a somewhat eccentric HTML+CSS string format. */
- (NSString *)getDowntimeSchedule;

The first and last of those will cause a new delegate method to be called on your MGTwitterEngineDelegate object, namely:

- (void)miscInfoReceived:(NSArray *)miscInfo forRequest:(NSString *)identifier;

You can try those methods out to see how they work, or read the Twitter API documentation for more details.

Grab the code from the subversion repository as always, or just update your existing copy via Xcode or the command-line.