README.rdoc in whatser-0.4.0 vs README.rdoc in whatser-0.5.0
- old
+ new
@@ -5,11 +5,11 @@
== Overview
* read/write API access
* OAuth 2 authentication (using oauth2)
* network connectivity (using httparty)
-* simple DSL for API resource classes (spots, media, reviews, check ins, etc.)
+* simple DSL for API resource classes (spots, media, comments, check ins, etc.)
* user spot collection management
* check-in aggregation
* social network integration (facebook, twitter, foursquare, gowalla)
* photo uploads
@@ -109,11 +109,11 @@
Whatser.client.users.invite( :emails => 'first@example.com;second@example.com;third@example.com' )
Whatser.client.users.create( params[:user] )
m = Whatser.client.users.find( user_id )
m.connection
- <Whatser::User @bio="Example", @location="Amsterdam, NL", @facebook_id="1234567890", @email="user@example.com", @gowalla_id="1234567890", @avatar_pic="http://example.com/img/14.jpg", @promoted=false, @name="User", @twitter_name="example", @last_login_at="2010-12-24T16:46:23Z", @twitter_id="1234567890", @id=101, @foursquare_id="1234567890">
+ <Whatser::User @bio="Example", @location="Amsterdam, NL", @facebook_id="1234567890", @email="user@example.com", @gowalla_id="1234567890", @avatar_pic="http://example.com/img/14.jpg", @promoted=false, @name="User", @twitter_name="example", @last_login_at="2010-12-24T16:46:23Z", @twitter_id="1234567890", @id=101, @foursquare_id="1234567890", @thanks_count=0, @poi_count=0, @check_ins_count=0, @media_count=0, @taggings_count=0, @follows_count=0, @followers_count=0, @comments_count=0>
The API also permits anonymous user access, but in order to do so an anonymous user must first be created. Anonymous users have limited privileges and no email address, but otherwise function identically to authorized users. After the user is created, you can get the oauth token to use with your client and perform actions on behalf of the anonymous user.
client = Whatser::Client.new
anonymous = client.users.anonymous
@@ -132,12 +132,11 @@
Whatser.client.spots.create( :name => 'my spot', :lat => 52.0, :lng => 4.0, :street => '123 st.', :region => 'Noord Holland', :city => 'Amsterdam', :postal_code => '1012', :country => 'Netherlands' )
Whatser.client.spots.delete( spot_id )
m = Whatser.client.spots.new( :name => 'my spot', :lat => 52.0, :lng => 4.0 )
m.save
m.delete
- results = m.details
- results = m.reviews
+ results = m.comments
results = m.tags
results = m.activity
<Whatser::Poi @lng=4.0, @region="Noord Holland", @gowalla_id="123456", @lat=52.0, @tag_list=nil, @city="Amsterdam", @name="Example Spot", @country="Netherlands", @street="example street", @id=101, @postal_code="1012", @foursquare_id="123456", @created_at="2010-12-24T16:46:23Z">
@@ -168,40 +167,10 @@
Whatser.client.cities.user( user_id, :page => 1, :per_page => 10 )
<Whatser::City @count=5, @name="Amsterdam">
-=== Reviews
-
-A review is a short- to long-form text article about a spot.
-
- Whatser.client.reviews.list( spot_id, :page => 1, :per_page => 10 )
- Whatser.client.reviews.find( spot_id, review_id )
- Whatser.client.reviews.create( spot_id, :body => 'my spot review.' )
- Whatser.client.reviews.delete( spot_id, review_id )
- m = Whatser.client.reviews.new( :body => 'my spot review.' )
- m.save
- m.delete
-
- <Whatser::Review @user_id=null, @id=101, @body="whatser spot review.", @created_at="2010-12-24T16:45:55Z">
-
-
-=== Details
-
-Details are miscellaneous, freeform information about a spot, such as operating hours, pricing, etc. The data attribute serializes a hash, which can be used to store arbitrary spot details.
-
- Whatser.client.details.list( spot_id, :page => 1, :per_page => 10 )
- Whatser.client.details.find( spot_id, details_id )
- Whatser.client.details.create( spot_id, :data => {:title => 'details', :opening_hours => '8:00-5:00'} )
- Whatser.client.details.delete( spot_id, review_id )
- m = Whatser.client.details.new( :data => {:title => 'details', :opening_hours => '8:00-5:00'} )
- m.save
- m.delete
-
- <Whatser::Detail @data={"meta"=>"Long metadata here", "opening_hours" => "9-5"}, @user_id=null, @id=101>
-
-
=== Media
Media are photos, logos, and other graphics associated with a spot. You can create new media either by supplying a file for a multipart upload, or else with a link to an existing online image.
Whatser.client.media.list( spot_id, :page => 1, :per_page => 10 )
@@ -224,13 +193,22 @@
Whatser.client.tags.delete( spot_id, 'my tag' )
m = Whatser.client.tags.new( :name => 'my tag' )
m.save
m.delete
- <Whatser::Tag @name="my tag">
+Tags can also be accessed through their spot, either by calling the model's cached tag_list, branded_tags, or making an API request for a full tag listing.
+ spot = Whatser.client.spots.find( spot_id )
+ spot.tag_list
+ spot.branded_tags
+ spot.tags
+In addition to user tags, some spots will also have branded tags, keywords promoted by Whatser partners and associated with branded images; for normal user tags, these image urls are not used. The images are customized for three platforms (web, touch, and wap), and two sizes (list and detail).
+
+ <Whatser::Tag @name="my tag", @poi_id=101, @web_list_pic="http://wht.sr/1.png", @web_detail_pic="http://wht.sr/2.png", @touch_list_pic="http://wht.sr/3.png", @touch_detail_pic="http://wht.sr/4.png", @wap_list_pic="http://wht.sr/5.png", @wap_detail_pic="http://wht.sr/6.png">
+
+
=== Follows
Follows represent a user's interest in another user, namely the user's spot activity, collections, and content. Following another user integrates that user's Whatser social and POI graph into the follower's suggestions and other dynamic Whatser content.
Whatser.client.follows.list( :page => 1, :per_page => 10 )
@@ -239,11 +217,11 @@
Whatser.client.follows.connection( user_id )
m = Whatser.client.follows.new( params[:user] )
m.save
m.delete
- <Whatser::Follow @location="Amsterdam, NL", @premium=false, @avatar_pic="http://example.com/avatars/thumb/1.jpg", @promoted=false, @name="Example User", @id=1>
+ <Whatser::Follow @location="Amsterdam, NL", @avatar_pic="http://example.com/avatars/thumb/1.jpg", @promoted=false, @name="Example User", @id=1>
=== Check Ins
A check in represents a user's visit to a spot, and will typically have a counterpart in other location-based applications such as Foursquare, Gowalla, and Facebook Places.
@@ -254,22 +232,10 @@
m.save
<Whatser::CheckIn @message="statuscastin' over here", @lng=4.8931739, @rating=3, @lat=52.3665312, @check_out_at="2010-12-24T16:46:38Z", @name="Popular Spot", @poi_id=101, @check_in_at="2010-12-24T16:31:38Z", @user_id=101>
-=== Data Sources
-
-A data source represents a free or purchasable content stream of collected spots, media, and reviews. Users can subscribe to data sources in order to access their content in Whatser. To begin the subscription and payment process, redirect your user to the data source's subscription_url.
-
- Whatser.client.data_sources.list( :page => 1, :per_page => 10 )
- Whatser.client.data_sources.for_users( :user_id => [101,23], :page => 1, :per_page => 10 )
- m = Whatser.client.data_sources.find( 1 )
- redirect_to m.subscription_url(:display => 'touch')
-
- <Whatser::DataSource @review_count=405, @poi_count=0, @price=0.0, @collection_count=0, @name="Rough Guides - Barcelona", @media_count=0, @id=9, @users=[{"name": "premium user", "id": 33}]>
-
-
=== Comments
A comment is just a short user note that can be associated with other resources. At the moment, you can comment on a POI, Media, or an Activity Feed. Users can also delete their own comments.
Whatser.client.comments.poi( poi_id, :page => 1, :per_page => 10 )
@@ -340,8 +306,8 @@
* Whatser: http://www.whatser.com
* Twitter: @whatserapi
== Copyright
-Copyright (c) 2010 Travis Dunn / SoGeo Company. See LICENSE.txt for
+Copyright (c) 2010-2011 Travis Dunn / SoGeo Company. See LICENSE.txt for
further details.