Matt Legend Gemmell Modesty is Lying

Mac OS X Cocoa and iPhone Development Services available at Instinctive Code.
Favorites icon
Favorites for iPhone
Speed-dial with style.
Mac OS X Cocoa and iPhone Developer for hire

Other Pages

Categories

Posted
5 August 2008 @ 10am

Categories
Development, Source

Tags
, , , , , , , , , , , ,

MGTwitterEngine important update

To all those using my MGTwitterEngine code on either Mac OS X or iPhone OS, please update your code from the Subversion repository. Please note that you should always be using the repository; I’m not making any effort to keep static zip-files of the code up to date. If you don’t know how to get code from the repository, see the notes at the end of this post.

This version brings a few improvements and some fixes, as detailed below.

  • On August 1st, Twitter pushed out an update to the Twitter API to correct a security flaw in the service. This update was released with just 2 hours’ notice, and I’ve only now had a chance to make the corresponding updates in MGTwitterEngine. If you were getting HTTP 400 errors when using MGTwitterEngine to follow/unfollow people, set favorite tweets, delete tweets or direct messages, and a few other things, this new version fixes the issue. No code-changes on your part will be necessary.
  • Significantly, MGTwitterEngine now incorporates the various improvements from the Iconfactory’s Twitterrific client for iPhone (which uses MGTwitterEngine). One major improvement is that you can now optionally use LibXML instead of NSXMLParser (on either Mac OS or iPhone) for better XML-parsing performance. See the included README file for more information on that (notably you’ll have to add a path to your project’s Header Search Paths to avoid compilation errors).
  • We now support a new method to test whether a given user receives updates from a given other user (i.e. if user1 is “friends with” user2). The new method is -isUser:receivingUpdatesFor:.
  • We now support the new parameters in the methods to retrieve either friends or user timelines. Namely, you can now specify a starting page-number and/or a number of tweets to retrieve for either method, and you can also specify either an optional starting date or a specific starting tweet-ID. This will be useful for Twitter clients which maintain state (as yours should).

Many thanks to Craig Hockenberry (chockenberry on Twitter) for his great work on Twitterrific and for contributing his improvements back into the codebase for everyone’s benefit - even his competitors!

We both hope you’ll enjoy this new version of MGTwitterEngine on Mac OS X and iPhone.

How to get code from the Subversion repository

Just launch the Terminal application (it’s in /Applications/Utilities), paste the following command into the window (all on one line) and then press Return:

svn checkout http://svn.cocoasourcecode.com/MGTwitterEngine ~/Desktop/MGTwitterEngine

That command will checkout the latest copy of the source into a folder on your Desktop called “MGTwitterEngine”. The actual name of the folder is up to you, and you can then move that folder anywhere you like.

Whenever you want to update to the latest version of the code thereafter, launch the Terminal application again and use the commands below. Note that there are two commands, and that they should be pasted into Terminal one at a time, pressing Return after each. Also note that you should obviously change the first command to use the actual path to wherever you’re keeping the code.

cd ~/Desktop/MGTwitterEngine

svn update

If you want to find out more about Subversion, you can read the free online Subversion book.


1 Comment

Robert McGovern
9 August 2008 @ 11am

Hi, this caught me out after updating to the newest version.

While the readme implies that using LibXML is optional it appears that the lib needs to be added as an “other framework” for compilation regardless of what USE_LIBXML is set to.

On a project with all the the required MGTwitter* files imported and with USE_LIBXML set to 0 there are 20 compilation errors (4 real, repeated 5 times each)

Line Location MGTwitterLibXMLParser.h:16: error: libxml/xmlreader.h: No such file or directory
Line Location MGTwitterLibXMLParser.h:29: error: syntax error before ‘xmlTextReaderPtr’
Line Location MGTwitterLibXMLParser.h:42: error: syntax error before ‘xmlChar’
Line Location MGTwitterLibXMLParser.h:43: fatal error: method definition not in @implementation context

Adding the framework and the header search path makes the errors go away.

One last thing, curious as to why you say to add /usr/lib/libxml2.dylib & not the SDK version /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libxml2.2.dylib to the project if you are working on a Mac version.

Many thanks for your continued work on this source code.

Rob


Leave a Comment

iPhone Developer Complaints NaNoWriMo for iPhone apps