Freebase and the iPhone
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Freebase and the iPhone

  • 3,127 views
Uploaded 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

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
3,127
On Slideshare
2,892
From Embeds
235
Number of Embeds
6

Actions

Shares
Downloads
19
Comments
0
Likes
1

Embeds 235

http://blog.freebase.com 223
http://www.slideshare.net 5
https://www.linkedin.com 3
http://translate.googleusercontent.com 2
http://www.hanrss.com 1
http://www.linkedin.com 1

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?