skore 0.0.1.pre.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7fe659042f73a8d42646f27a09fc06a1102c5aa3
4
+ data.tar.gz: e051b493dcc45ba886015527ef164539d6dd817d
5
+ SHA512:
6
+ metadata.gz: 73f74ee6b09a3418351149f32d71c56c3220ea908a9732271b395e360a566bcf692fda49f99365ee18b25ccc4a7e0475186ec8d16005965db8dd64c89f0b3295
7
+ data.tar.gz: acf57d4a25700132e850c0e099d3ee3c48731df068c6e79b68eda728e4cfa02ca4e1272f57ceb726e52fc71fa130279ec53363918eb49b335c60e2ef4ff01ea5
data/.gitignore ADDED
@@ -0,0 +1,23 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
23
+ testing.rb
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in skore.gemspec
4
+ gemspec
5
+
6
+ gem 'httparty'
7
+ gem 'klout'
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Angel Botto
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,56 @@
1
+ # Skore
2
+
3
+ Skore is a gem that has basic function is to analyze the social score of a user of different platforms like **Klout, Kred and PeerIndex**
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'skore'
10
+
11
+ Or install it yourself as:
12
+
13
+ $ gem install skore
14
+
15
+ ## Usage
16
+
17
+ Using skore is quite simple, just having the right to feed each of the platforms **(klout, kred, & PeerIndex)** and the user that you want to identify keys.
18
+
19
+ ### Get Klout Score
20
+
21
+ user = Skore::KloutSkore.new(API_KEY, TWITTER_USERNAME)
22
+ puts user.score
23
+
24
+
25
+ return float number like 55.394093
26
+
27
+ if you want to round the score simply add true method to ```score```
28
+
29
+ user = Skore::KloutSkore.new(API_KEY, TWITTER_USERNAME)
30
+ puts user.score true
31
+
32
+
33
+ return 55
34
+
35
+ ### Get Kred Score
36
+
37
+ user = Skore::Kred.new(APP_ID, APP_KEY, TWITTER_USERNAME)
38
+ puts user.score
39
+
40
+ return number like 777
41
+
42
+
43
+ ### Get PeerIndex Score
44
+
45
+ user = Skore::PeerIndex.new(API_KEY, TWITTER_USERNAME)
46
+ puts user.score
47
+
48
+ return number like 30
49
+
50
+ ## Contributing
51
+
52
+ 1. Fork it ( https://github.com/kreattiewe/skore/fork )
53
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
54
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
55
+ 4. Push to the branch (`git push origin my-new-feature`)
56
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/lib/skore.rb ADDED
@@ -0,0 +1,4 @@
1
+ require "skore/version"
2
+ require "skore/klout"
3
+ require "skore/kred"
4
+ require "skore/peerindex"
@@ -0,0 +1,28 @@
1
+ require 'klout'
2
+ ##
3
+ # This module analize and extract score from social analizer http://klout.com
4
+ module Skore
5
+ class KloutSkore
6
+
7
+ ##
8
+ # Include module and clases from Klout
9
+ include Klout
10
+
11
+ attr_accessor :user
12
+ ##
13
+ # Initialize Base and almacenate user information
14
+ def initialize(api_key, username)
15
+ Klout.api_key = api_key
16
+ identity = Identity.find_by_screen_name(username)
17
+ @user = User.new(identity.id)
18
+ end
19
+
20
+ ##
21
+ # Get score for user
22
+ def score(round=false)
23
+ if round then @user.score.score.round else @user.score.score end
24
+ end
25
+
26
+
27
+ end
28
+ end
data/lib/skore/kred.rb ADDED
@@ -0,0 +1,38 @@
1
+ require 'httparty'
2
+
3
+ ##
4
+ # This module analize and extract score from social analizer http://kred.com
5
+ module Skore
6
+ class Kred
7
+
8
+ ##
9
+ # Include httparty module from http querys
10
+ include HTTParty
11
+ base_uri "http://api.kred.com/kredscore"
12
+ default_timeout 1
13
+
14
+ attr_accessor :data
15
+
16
+ ##
17
+ # Initialize and load data from kred api
18
+ def initialize(app_id, app_key, username)
19
+ begin
20
+ @data = self.class.get("?term=#{username}&source=twitter&app_id=#{app_id}&app_key=#{app_key}")
21
+ rescue Timeout::Error
22
+ @data = false
23
+ end
24
+ end
25
+
26
+ ##
27
+ # Get score from Kred api
28
+ def score
29
+ if @data
30
+ result = JSON.parse(@data.body)
31
+ result["data"][0]["influence"]
32
+ else
33
+ -1
34
+ end
35
+ end
36
+
37
+ end
38
+ end
@@ -0,0 +1,38 @@
1
+ require 'httparty'
2
+
3
+ ##
4
+ # This module analize and extract score from social analizer http://kred.com
5
+ module Skore
6
+ class PeerIndex
7
+
8
+ ##
9
+ # Include httparty module from http querys
10
+ include HTTParty
11
+ base_uri "https://api.peerindex.com/1/actor/topic"
12
+ default_timeout 1
13
+
14
+ attr_accessor :data
15
+
16
+ ##
17
+ # Initialize and load data from kred api
18
+ def initialize(api_key, username)
19
+ begin
20
+ @data = self.class.get("?twitter_screen_name=#{username}&api_key=#{api_key}")
21
+ rescue Timeout::Error
22
+ @data = false
23
+ end
24
+ end
25
+
26
+ ##
27
+ # Get core from peerindex api
28
+ def score
29
+ if @data
30
+ result = JSON.parse(@data.body)
31
+ result["peerindex"]
32
+ else
33
+ -1
34
+ end
35
+ end
36
+
37
+ end
38
+ end
@@ -0,0 +1,3 @@
1
+ module Skore
2
+ VERSION = "0.0.1-1"
3
+ end
data/skore.gemspec ADDED
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'skore/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "skore"
8
+ spec.version = Skore::VERSION
9
+ spec.authors = ["Angel Botto"]
10
+ spec.email = ["angelbotto@gmail.com"]
11
+ spec.summary = "Analize social score from users."
12
+ spec.description = "Analize social score from users"
13
+ spec.homepage = "http://kreattiewe.com/gem/skore"
14
+ spec.post_install_message = "Thanks for instaling!!"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0")
18
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.6"
23
+ spec.add_development_dependency "rspec", "~> 3.1.0"
24
+ spec.add_development_dependency "rake"
25
+
26
+
27
+ end
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: skore
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1.pre.1
5
+ platform: ruby
6
+ authors:
7
+ - Angel Botto
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-09-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 3.1.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: 3.1.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Analize social score from users
56
+ email:
57
+ - angelbotto@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - .gitignore
63
+ - Gemfile
64
+ - LICENSE.txt
65
+ - README.md
66
+ - Rakefile
67
+ - lib/skore.rb
68
+ - lib/skore/klout.rb
69
+ - lib/skore/kred.rb
70
+ - lib/skore/peerindex.rb
71
+ - lib/skore/version.rb
72
+ - skore.gemspec
73
+ homepage: http://kreattiewe.com/gem/skore
74
+ licenses:
75
+ - MIT
76
+ metadata: {}
77
+ post_install_message: Thanks for instaling!!
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - '>'
89
+ - !ruby/object:Gem::Version
90
+ version: 1.3.1
91
+ requirements: []
92
+ rubyforge_project:
93
+ rubygems_version: 2.2.2
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: Analize social score from users.
97
+ test_files: []