Firstly, I’d just like to explain what the ‘Twitpocalpyse’ is to all those who don’t know:
On Friday evening, the number of tweets exceeded 2,147,483,6471. While that doesn’t seem like a round number, it’s the largest number that can be stored as the data type known as a “signed integer.” Once that number was exceeded, some versions of some Twitter client apps could break in a fashion similar to what was expected during the Y2K “millennium bug” era.
As I am using the MGTwitterEngine, I thought I’d like to post up how to fix the bug, with thanks to someone named kleinman.
http://gist.github.com/111435
add in MGTWitterYAJLParser.m
-------
int process_yajl_number(void *ctx, const char *numberVal, int size)
{
id self = ctx;
if (currentKey) {
// We alloc a proper buffer and copy the chars in it along with a null
char *zeroTerminatedBuf = calloc(1, size+1);
memcpy(zeroTerminatedBuf, numberVal, size);
// Then we put everything in an NSString so we can initialize our NSNumber with the corresponding long long
NSString *rawValue = [NSString stringWithCString:zeroTerminatedBuf];
NSNumber *longLongValue = [NSNumber numberWithLongLong:[rawValue longLongValue]];
[self addValue:longLongValue forKey:currentKey];
free(zeroTerminatedBuf);
[currentKey release];
currentKey = nil;
}
return 1;
}
static yajl_callbacks callbacks = {
process_yajl_null,
process_yajl_boolean,
process_yajl_integer,
process_yajl_double,
// Put number callback so we can properly handle a long long value
// Martin Dufort - WhereCloud Inc
process_yajl_number,
//
process_yajl_string,
process_yajl_start_map,
process_yajl_map_key,
process_yajl_end_map,
process_yajl_start_array,
process_yajl_end_array
};
Here’s a video preview of what you can expect from Twitterville.
After much time improving the app, I’ve now finally sent it off to Apple for review! Should be up in the app store in the next couple of weeks
Release notes
✔ Added a ‘Dark’ theme
✔ Added a ‘Pro’ theme
✔ Added ‘Notes’ shortening
✔ Added a sent tweet sounds
✔ Added sent tweet vibration
✔ Added TweetPhoto support
✔ Added a custom URL scheme of ‘twttr:’
✔ Code optimization
✔ Faster loading times on certain views
✔ Fixed memory management
✔ Major bug fixes
✔ Fixed the ‘More’ table
✔ Added ‘Nearby’ tweets and search
✔ Added ability to ‘Stop Following’ a user
✔ Updated the Twitter engine
✔ Added IMG.LY support for image uploads
✔ Infinite timeline
✔ View own followers list
Screenshots
Just a quick notice to say that Twitterville v1.2.1 has been sent off to Apple for review.
This contains the following changes:
- Bug fixes
- Added the ‘Twitturly Top 100′ page
- When refreshing the timelines, the navigation bar now says, “Refreshing…” on it
- A tweet longer than 140 characters can now be split up into 2 tweets automatically using the ‘Spread Tweet’ feature
- Direct messages now notifies the user when a message has been sent and closes the compose screen
- The main tab bar is now hidden when the user goes to the message view
- Added the URL shortener ‘TDY.ME’ to Twitterville
- User can now import their current location before editing it with ‘Edit Location’
- Updated image caching to save and load quicker
- Added the ability to ‘Watch users
- Now shows a confirmation alert to ask the user if they are sure they want to delete a tweet
- When closing the web view it actually stops loading the page
- Fixed a bug which caused the main timeline to refresh randomly
- Fixed a bug which caused the app to crash when adding a favorite
- Fixed a bug which caused the app to crash when clicking the follow user button
- Fixed a bug which caused the app to crash when loading up without any username or password
- Fixed a bug which caused the ‘Mentions’ tab to randomly reload without the user telling it to
- Fixed a bug which caused the ‘Mentions’ tab to crash when a user hadn’t added a username or password into the app
- Fixed a bug which caused the ‘Messages’ tab to crash on some iPhone OS versions
- Modified the code which caused the app to put a space in front of an image URL even when no text had been entered
- Added a ‘Options’ button to the profile view
- This let’s the user select more options such as show their recent tweets
- User can now view theirs or another users latest updated following list
What’s this I’m hearing?
Well, what shrt.li for the iPhone simply is, is a website you can access to shorten URLs and have a link given to you to automatically post the link to a new tweet from Twitterville on your iPhone!
Isn’t it easier to use a bookmarklet and shorten it within Twitterville using TDY.ME?
It is! And I suggest that you do actually go and use the bookmarklet! However, if you don’t have it installed, then by no means, use the shrt.li way.
Hmm… the ‘Send to Twitterville’ doesn’t open the app?!
This is either because you do not have Twitterville installed or you are not at version 1.3. The link to open Twitterville requires version 1.3 (this installs the custom URL scheme for twttr:)
There must be another way too…
There is indeed!! If you ever get ANY link on your iPhone Safari browser you can add something on the beginning of the URL to send it to a new tweet. It doesn’t even have to be a link!
For example, if your iPhone web browser had http://website.com/sub/image.png then you just have to add twttr: to the beginning of it so it looks like this twttr:http://website.com/sub/image.png and then Twitterville will open with the link.




