nom-ruby 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,5 +8,7 @@
8
8
  - Author: Brian Norton
9
9
  - Locations { here, search}
10
10
  - Users { register, login, search }
11
- - Seen at [rubygems/nom-ruby]() and [github/nom-ruby](https://github.com/bnorton/nom-ruby)
11
+ - Seen at [rubygems/nom-ruby](https://rubygems.org/gems/nom-ruby) and [github/nom-ruby](https://github.com/bnorton/nom-ruby)
12
12
 
13
+ ####0.2.1 - Bugfix
14
+ - naming was off for an api method
data/README.md CHANGED
@@ -6,13 +6,70 @@
6
6
  - https://justnom.it/activities.json?user_nid=4eccc0fbeef0a64dcf000001
7
7
  - https://justnom.it/locations/search.json?lng=-122.3898&lat=37.81273&query=king
8
8
 
9
- ## Usage:
10
- @api_handle = Nom::API.new(:key => "your developer key")
11
- @user = @api_handle.login('user_name or email', 'password')
12
- @locations = @api_handle.here(:lat => 33.3, :lng => -122.2)
13
- @activities = @api_handle.activities(:user_nid => '4eccc0fbeef0a64dcf000001')
14
- @api_handle.recommend(:text => 'I Just Nommed at ...', :user_nid => '4eccc0fbeef0a64dcf000001', :auth_token => '2af...fad3y')
15
- @api_handle.thumb(:location_nid => "4edgc0fbadf0a64dcf110037", :user_nid => '4eccc0fbeef0a64dcf000001', :auth_token => '2af...fad3y')
9
+ ###Getting Started
10
+ #####Dependencies:
11
+ - `json`
12
+ - `net/http`
13
+
14
+ #####Setup:
15
+ - `gem install nom-ruby`
16
+ - In an initializer `require 'nom-ruby'`
17
+ - Then just make the new API handle with `handle = Nom::API.new`
18
+
19
+ ###Examples:
20
+
21
+ ####Location (here):
22
+ handle = Nom::API.new
23
+ locations = handle.here(37.7969, -122.39955)
24
+
25
+ ####Location (here - paginated to page 3):
26
+ handle = Nom::API.new
27
+ locations = handle.here(37.7969, -122.39955, {
28
+ :start => 30,
29
+ :limit => 15
30
+ })
31
+
32
+ ####Geolocation based search for 'vegetarian'
33
+ handle = Nom::API.new
34
+ locations = handle.location_search('vegetarian', {
35
+ :lat => 37.7969,
36
+ :lng => -122.39955
37
+ })
38
+
39
+
40
+ ####User search for 'team'
41
+ handle = Nom::API.new
42
+ users = handle.user_search('team')
43
+ users = handle.user_search('test_accout@justnom.it')
44
+
45
+ ####User registration (simple):
46
+ handle = Nom::API.new
47
+ user = handle.register('test_accout@justnom.it', 'a_password')
48
+
49
+ ####User registration (with options):
50
+ handle = Nom::API.new
51
+ user = handle.register('test_accout@justnom.it', 'a_password', {
52
+ :name => "The Nom Team",
53
+ :city => 'San Francisco',
54
+ :screen_name => 'team'
55
+ })
56
+
57
+ ####User Login (identifier and password based)
58
+ handle = Nom::API.new
59
+ user = handle.login('a_password', {:email => 'test_accout2@justnom.it'})
60
+ user = handle.login('a_password', {:user_nid => '4efd9128eef0a63881000001'}) ## same user a above
61
+
62
+ ####Yet Unimplemented
63
+
64
+ #### Not yet implemented ####
65
+ # activities = handle.activities(:user_nid => '4eccc0fbeef0a64dcf000001')
66
+ # handle.recommend(:text => 'I Just Nommed at ...', :user_nid => '4eccc0fbeef0a64dcf000001', :auth_token => '2af...fad3y')
67
+ # handle.thumb(:location_nid => "4edgc0fbadf0a64dcf110037", :user_nid => '4eccc0fbeef0a64dcf000001', :auth_token => '2af...fad3y')
68
+ #############################
69
+
70
+
71
+ ###Key For Response types:
72
+ - The `@` symbol is used to denote an entity unto itself. In the case of `@location` then in place you can logically expand a location object for `@location`. This is done for brevity.
16
73
 
17
74
  ## All Success Results Take the Form:
18
75
  {
@@ -42,7 +99,7 @@
42
99
  updated_at: "2011-12-20T07:06:57Z",
43
100
  url: "http://justnom.it/users/bn",
44
101
  has_joined: true,
45
- follower_count: 16,
102
+ follower_count: 164,
46
103
  user_nid: "4eccc0fbeef0a64dcf000001",
47
104
  screen_name: "bn"
48
105
  }
@@ -50,7 +50,7 @@ module Nom
50
50
 
51
51
  def user_search(query, options = {})
52
52
  start, limit = Nom::Util.page(options)
53
- Nom::API.handle.get('/locations/search', {
53
+ Nom::API.handle.get('/users/search', {
54
54
  :query => query, # If the input value is of unknown origin
55
55
  :screen_name => options[:screen_name],
56
56
  :email => options[:email]
@@ -2,7 +2,7 @@ module GemNom
2
2
  module VERSION
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- PATCH = 0
5
+ PATCH = 1
6
6
  PRE = nil
7
7
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nom-ruby
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brian Norton