Your SlideShare is downloading. ×
Freebase and the iPhone
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Freebase and the iPhone

2,187
views

Published on

A presentation at the December Freebase meetup about the Freebase.framework iPhone library

A presentation at the December Freebase meetup about the Freebase.framework iPhone library

Published in: Technology, News & Politics

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,187
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
20
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Transcript

    • 1. Freebase on the iPhone Alec Flett <alecf@metaweb.com>
    • 2. Freebase on the iPhone Tonight: • Freebase.framework • PhotoBase • Hacking
    • 3. Freebase.framework What’s included: • Static library • Fully Asynchronous API access • CocoaTouch (iPhone) widgets
    • 4. Freebase.framework • Static library • Help. I don’t know what I’m doing • API stuff mostly works on OS X too • Even works with PyObjC!
    • 5. Freebase.framework • Freebase APIs • login • mqlread, mqlwrite • search, geosearch • imageThumb, blurb • image upload • touch
    • 6. Freebase.framework APIs Delegate/selector model FreebaseSession *session = [FreebaseSession session]; [session <apicall>:<query> name:@”convenience_name” delegate:obj didFinishSelector:@selector(someselector:name:etc:) options:[NSDictionary dictionary...]]; • “name” is just useful • “options” is optional
    • 7. Freebase.framework APIs delegates and didFinishSelector • specific selector called on success - (void)querydone:(id)result name:(NSString*)name cursor:(NSString*)cursor; • cursor is mqlread only • errorDidOccur:name: on failure
    • 8. Freebase.framework • CocoaTouch widgets • FreebaseTable - infinite scrolling, sections, thumbnails • FreebaseSuggest - pick a topic, with location support • FreebaseDetail - minimalistic topic view
    • 9. FreebaseTable
    • 10. FreebaseSuggest
    • 11. Geolocation
    • 12. Topic chosen
    • 13. PhotoBase More than just a sample app...
    • 14. PhotoBase Take a picture Choose a topic Upload to Freebase
    • 15. PhotoBase Logging in [[Freebase session] login:@”alecf” password:@”nice try”, delegate:self didFinishSelector:@selector(loggedin:)];
    • 16. PhotoBase Choosing a topic FreebaseSuggest uses search/geosearch, mqlread, blurb, imageThumb
    • 17. PhotoBase Use FreebaseSuggest FreebaseSuggest *fbs = [[FreebaseSuggest alloc] init]; fbs.delegate = self; [self presentModalViewController:fbs animated:YES]; // callback definition - (void)suggest:(FreebaseSuggest*)suggest itemSelected:(NSDictionary*)item { NSString* topicName = [item objectForKey:@”name”]; ... }
    • 18. FreebaseSuggest Finding topics: [session search:@”x-men” name:@”suggest” delegate:self didFinishSelector:@selector(haveResult:)]; Or geolocate: NSString *location = [[NSDictionary dictionaryWithObjectsAndKeys: @"Point", @"type", [NSArray arrayWithObjects: [NSNumber numberWithDouble:longtitude], [NSNumber numberWithDouble:latitude], nil], @"coordinates", nil] JSONRepresentation]; [session geosearch:location name:@”suggest-geo” delegate:self didFinishSelector:@selector(haveResult:)]; (geolocate + search string is complex)
    • 19. PhotoBase Choose or take a picture (Built into iPhone API: UIImagePickerController)
    • 20. PhotoBase Now upload...
    • 21. PhotoBase Upload implementation: [[FreebaseSession session] uploadImage:image contentType:@"image/jpeg" topic:[topic objectForKey:@"id"] delegate:self didFinishSelector:@selector(uploaded:) options: [NSDictionary dictionaryWithObjectsAndKeys: @"/en/creative_commons_by_sa_2_0", @"license", nil]];
    • 22. PhotoBase What’s left: • UI stuff - user feedback, login setup, etc Whats next: • Topic geotagging • QR importing • Flickr search • English/metric, distances, etc
    • 23. Freebase.framework
    • 24. Freebase.framework Do a little dance
    • 25. Freebase.framework Do a little dance Make a little app
    • 26. Freebase.framework Do a little dance Make a little app Lets hack tonight
    • 27. Freebase.framework Do a little dance Make a little app Lets hack tonight
    • 28. Freebase.framework Do a little dance Make a little app Lets hack tonight Questions?