fliptop 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +54 -0
- data/Rakefile +1 -0
- data/fliptop.gemspec +23 -0
- data/lib/fliptop.rb +6 -0
- data/lib/fliptop/person.rb +38 -0
- data/lib/fliptop/version.rb +3 -0
- metadata +86 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Amrit Ayalur
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
# Fliptop
|
2
|
+
|
3
|
+
A super simple Ruby wrapper for the Fliptop API.
|
4
|
+
|
5
|
+
DISCLAIMER: Currently, I don't have access to the Fliptop API. If you encounter any problems with the gem please file an issue. Thanks!
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
gem 'fliptop'
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install fliptop
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Refer to the [Fliptop API](https://developer.fliptop.com/documentation) for the full API documentation.
|
24
|
+
|
25
|
+
###Methods
|
26
|
+
|
27
|
+
The email method returns information about a person based on their email address. The method requires a valid ```email``` address and ```api_key```.
|
28
|
+
An optional ```format``` argument can be passed. The default response format is JSON, but XML is currently supported as well.
|
29
|
+
|
30
|
+
Multiple emails separated by commas can be passed to the method. e.g ```a.ayalur@gmail.com,foo@bar.com,you@me.com```
|
31
|
+
|
32
|
+
Person.email(email, api_key, format)
|
33
|
+
|
34
|
+
|
35
|
+
The twitter method returns information about a person based on their twitter profile. The method requires a valid ```twitter``` profile URL and ```api_key```.
|
36
|
+
An optional ```format``` argument can be passed. The default response format is JSON, but XML is currently supported as well.
|
37
|
+
|
38
|
+
Person.twitter(handle, api_key, format)
|
39
|
+
|
40
|
+
The facebook method returns information about a person based on their facebook profile. The method requires a valid ```facebook``` profile URL and ```api_key```.
|
41
|
+
An optional ```format``` argument can be passed. The default response format is JSON, but XML is currently supported as well.
|
42
|
+
|
43
|
+
def facebook(profile, api_key, format)
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
## Contributing
|
49
|
+
|
50
|
+
1. Fork it
|
51
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
52
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
53
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
54
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/fliptop.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'fliptop/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "fliptop"
|
8
|
+
gem.version = Fliptop::VERSION
|
9
|
+
gem.authors = ["Amrit Ayalur"]
|
10
|
+
gem.email = ["a.ayalur@gmail.com"]
|
11
|
+
gem.description = %q{Ruby wrapper for the Fliptop API.}
|
12
|
+
gem.summary = %q{Ruby wrapper for the Fliptop API}
|
13
|
+
gem.homepage = "https://github.com/aayalur/fliptop"
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
|
20
|
+
gem.add_development_dependency 'rake'
|
21
|
+
gem.add_development_dependency 'rspec'
|
22
|
+
|
23
|
+
end
|
data/lib/fliptop.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'open-uri'
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
class Person
|
7
|
+
|
8
|
+
def email(email, api_key, format=nil)
|
9
|
+
if format == 'xml'
|
10
|
+
open("http://api.fliptop.com/beta/person?email=#{email}&api_key=#{api_key}&format=xml")
|
11
|
+
else
|
12
|
+
open("http://api.fliptop.com/beta/person?email=#{email}&api_key=#{api_key}")
|
13
|
+
end
|
14
|
+
rescue
|
15
|
+
nil
|
16
|
+
end
|
17
|
+
|
18
|
+
def twitter(handle, api_key, format=nil)
|
19
|
+
if format == 'xml'
|
20
|
+
open("http://api.fliptop.com/beta/person?twitter=#{handle}&api_key=#{api_key}&format=xml")
|
21
|
+
else
|
22
|
+
open("http://api.fliptop.com/beta/person?twitter=#{handle}&api_key=#{api_key}")
|
23
|
+
end
|
24
|
+
rescue
|
25
|
+
nil
|
26
|
+
end
|
27
|
+
|
28
|
+
def facebook(profile, api_key, format=nil)
|
29
|
+
if format == 'xml'
|
30
|
+
open("http://api.fliptop.com/beta/person?facebook=#{profile}&api_key=#{api_key}&format=xml")
|
31
|
+
else
|
32
|
+
open("http://api.fliptop.com/beta/person?facebook=#{profile}&api_key=#{api_key}")
|
33
|
+
end
|
34
|
+
rescue
|
35
|
+
nil
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
metadata
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fliptop
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Amrit Ayalur
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-01-03 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rspec
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
description: Ruby wrapper for the Fliptop API.
|
47
|
+
email:
|
48
|
+
- a.ayalur@gmail.com
|
49
|
+
executables: []
|
50
|
+
extensions: []
|
51
|
+
extra_rdoc_files: []
|
52
|
+
files:
|
53
|
+
- .gitignore
|
54
|
+
- Gemfile
|
55
|
+
- LICENSE.txt
|
56
|
+
- README.md
|
57
|
+
- Rakefile
|
58
|
+
- fliptop.gemspec
|
59
|
+
- lib/fliptop.rb
|
60
|
+
- lib/fliptop/person.rb
|
61
|
+
- lib/fliptop/version.rb
|
62
|
+
homepage: https://github.com/aayalur/fliptop
|
63
|
+
licenses: []
|
64
|
+
post_install_message:
|
65
|
+
rdoc_options: []
|
66
|
+
require_paths:
|
67
|
+
- lib
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ! '>='
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ! '>='
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
requirements: []
|
81
|
+
rubyforge_project:
|
82
|
+
rubygems_version: 1.8.24
|
83
|
+
signing_key:
|
84
|
+
specification_version: 3
|
85
|
+
summary: Ruby wrapper for the Fliptop API
|
86
|
+
test_files: []
|