social_media_monitoring 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +51 -24
- data/lib/social_media_monitoring/client.rb +12 -2
- data/lib/social_media_monitoring/version.rb +1 -1
- data/social_media_monitoring.gemspec +2 -2
- data/test/client_test.rb +18 -2
- data/test/fixtures/vcr_cassettes/categories_de.yml +140 -0
- data/test/fixtures/vcr_cassettes/competitors_de.yml +82 -0
- data/test/fixtures/vcr_cassettes/create_keyword.yml +7 -7
- data/test/fixtures/vcr_cassettes/keywords.yml +9 -11
- data/test/fixtures/vcr_cassettes/sentiment.yml +5 -5
- data/test/fixtures/vcr_cassettes/show_keyword.yml +5 -5
- metadata +9 -4
data/README.md
CHANGED
@@ -20,55 +20,82 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
Sentiment Analysis
|
22
22
|
|
23
|
-
require 'social_media_monitoring'
|
23
|
+
require 'social_media_monitoring'
|
24
|
+
|
24
25
|
client = SocialMediaMonitoring::Client.new("987634f072b7c51db349bda9fd5cd6da")
|
25
|
-
=> #<SocialMediaMonitoring::Client:0x007fa19422d390 @api_key="987634f072b7c51db349bda9fd5cd6da", @api_path="">
|
26
26
|
|
27
|
-
sentiment = client.sentiment("I love Ruby!","en")
|
28
|
-
|
27
|
+
sentiment = client.sentiment("I love Ruby!","en")
|
28
|
+
`=> <Mash response=<Mash polarity=1 sentiment=0.325>>`
|
29
|
+
|
29
30
|
or
|
30
31
|
sentiment = client.sentiment("amore","it")
|
31
|
-
=> <Mash response=<Mash polarity=1 sentiment=0.325>>
|
32
32
|
|
33
|
+
`=> <Mash response=<Mash polarity=1 sentiment=0.325>>`
|
33
34
|
The sentiment analyzer returns a Mash which you can read like this:
|
34
|
-
sentiment.response.polarity
|
35
|
-
=> 1
|
36
|
-
sentiment.response.sentiment
|
37
|
-
=> 0.325
|
38
35
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
Spanish (es)
|
44
|
-
French (fr)
|
45
|
-
Turk (tr)
|
36
|
+
sentiment.response.polarity
|
37
|
+
=> 1
|
38
|
+
sentiment.response.sentiment
|
39
|
+
=> 0.325
|
46
40
|
|
41
|
+
At this time the API supports the following languages:
|
42
|
+
* English (en)
|
43
|
+
* German (de)
|
44
|
+
* Italian (it)
|
45
|
+
* Spanish (es)
|
46
|
+
* French (fr)
|
47
|
+
* Turkish (tr)
|
47
48
|
|
48
49
|
Keyword tracking
|
49
50
|
|
50
|
-
require 'social_media_monitoring'
|
51
|
-
client = SocialMediaMonitoring::Client.new("987634f072b7c51db349bda9fd5cd6da")
|
52
|
-
|
51
|
+
require 'social_media_monitoring'
|
52
|
+
`client = SocialMediaMonitoring::Client.new("987634f072b7c51db349bda9fd5cd6da")`
|
53
|
+
|
54
|
+
`=> #<SocialMediaMonitoring::Client:0x007fa19422d390 @api_key="987634f072b7c51db349bda9fd5cd6da", @api_path="">`
|
53
55
|
|
54
|
-
client.create_keyword("Ruby rulez")
|
55
|
-
|
56
|
+
client.create_keyword("Ruby rulez")
|
57
|
+
`=> <Mash response=<Mash first_check="2012-07-02T23:36:32+00:00" id=553 keyword="Ruby rulez">>`
|
56
58
|
|
57
59
|
It responds with the keyword id, keyword and a date which tells you when you should expect results. The rankings will be updated frequently and
|
58
60
|
the history is stored. This allows you to track keyword positions in search results over time.
|
59
61
|
|
60
|
-
client.keywords
|
62
|
+
client.keywords
|
61
63
|
|
62
|
-
|
64
|
+
`=> returns a Mash with keywords you are tracking`
|
63
65
|
|
64
66
|
client.show_keyword(553) #id of keyword
|
65
67
|
|
66
|
-
|
68
|
+
`=> returns current and historic rankings`
|
67
69
|
|
68
70
|
The search results are paginated
|
69
71
|
|
70
72
|
You can get a free API key at https://developer.apphera.com
|
71
73
|
|
74
|
+
Competitor search (In BETA, GERMANY ONLY!)
|
75
|
+
|
76
|
+
To perform a competitor search you need to pass in the category id and the geo location as a string build from latitude and longitude.
|
77
|
+
You can retrieve a complete list of German category by sending a query to the API.
|
78
|
+
categories = client.categories("de")
|
79
|
+
`=> Returns a mash of categories`
|
80
|
+
|
81
|
+
Example:
|
82
|
+
category_id = 135
|
83
|
+
geo = "53.66,10.1154"
|
84
|
+
|
85
|
+
response = client.competitors(category_id, geo)
|
86
|
+
|
87
|
+
It returns a mash of companies in a radius of up to 20 miles who are competing in the same category of business. The results during the beta are limited to 20 companies per query.
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
KNOWN ISSUE:
|
92
|
+
In case you get a `"NoMethodError: undefined method `stringify_keys' for #<HTTParty::Response:0x007fa9231ab1b0>"`
|
93
|
+
- It's telling you that the api key is invalid and therefore can't handle the server response. Please get a valid api key.
|
94
|
+
|
95
|
+
Frequent question
|
96
|
+
What is a Mesh?
|
97
|
+
please visit https://github.com/intridea/hashie
|
98
|
+
|
72
99
|
|
73
100
|
## Contributing
|
74
101
|
|
@@ -5,7 +5,7 @@ module SocialMediaMonitoring
|
|
5
5
|
format :json
|
6
6
|
|
7
7
|
attr_reader :api_key
|
8
|
-
|
8
|
+
#curl -G -d "&api_key=638955fa280854f29a8b42b54cb1625e&country=de&cat_id=135&geo=53.66,10.1154" https://api.apphera.com/1/organizations
|
9
9
|
# Get a free api_key @ https://developer.apphera.com
|
10
10
|
def initialize(api_key=nil)
|
11
11
|
@api_key = api_key
|
@@ -13,7 +13,11 @@ module SocialMediaMonitoring
|
|
13
13
|
@api_path = ''
|
14
14
|
|
15
15
|
end
|
16
|
-
|
16
|
+
def categories(country)
|
17
|
+
results = Mash.new(self.class.get('/categories', :query => {:country => country}.merge(self.default_options)))
|
18
|
+
end
|
19
|
+
|
20
|
+
|
17
21
|
def keywords
|
18
22
|
results = Mash.new(self.class.get('/keywords', :query => self.default_options))
|
19
23
|
end
|
@@ -32,6 +36,12 @@ module SocialMediaMonitoring
|
|
32
36
|
options = {:body => {:body => body, :lang => lang}, :query => self.default_options}
|
33
37
|
results = Mash.new(self.class.post('/sentiments', options))
|
34
38
|
end
|
39
|
+
|
40
|
+
def competitors(cat_id, geo)
|
41
|
+
options = {:query => {:cat_id => cat_id, :geo => geo}.merge(self.default_options)}
|
42
|
+
results = Mash.new(self.class.get("/organizations", options))
|
43
|
+
end
|
44
|
+
|
35
45
|
|
36
46
|
|
37
47
|
protected
|
@@ -4,8 +4,8 @@ require File.expand_path('../lib/social_media_monitoring/version', __FILE__)
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.authors = ["Nikolai Manek"]
|
6
6
|
gem.email = ["niko.manek@gmail.com"]
|
7
|
-
gem.description = %q{Offers sentiment analysis and
|
8
|
-
gem.summary = %q{Keyword tracking, sentiment analysis}
|
7
|
+
gem.description = %q{Offers sentiment analysis,keyword tracking and geographic competitor search}
|
8
|
+
gem.summary = %q{Keyword tracking, sentiment analysis, competitor search}
|
9
9
|
gem.homepage = "https://github.com/nikoma/social_media_monitoring"
|
10
10
|
|
11
11
|
gem.files = `git ls-files`.split($\)
|
data/test/client_test.rb
CHANGED
@@ -12,12 +12,12 @@ VCR.configure do |c|
|
|
12
12
|
end
|
13
13
|
|
14
14
|
class VCRTest < Test::Unit::TestCase
|
15
|
-
$client = SocialMediaMonitoring::Client.new("
|
15
|
+
$client = SocialMediaMonitoring::Client.new("63ad4581c8746c06b511b3fe50f4ace5")
|
16
16
|
|
17
17
|
def test_keywords
|
18
18
|
VCR.use_cassette('keywords') do
|
19
19
|
response = $client.keywords.response.first.name
|
20
|
-
assert_match /
|
20
|
+
assert_match /ruby testing/, response
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -44,4 +44,20 @@ class VCRTest < Test::Unit::TestCase
|
|
44
44
|
assert_equal 1, response.to_i
|
45
45
|
end
|
46
46
|
end
|
47
|
+
|
48
|
+
def test_categories_de
|
49
|
+
VCR.use_cassette('categories_de') do
|
50
|
+
response = $client.categories("de").response
|
51
|
+
# assert_equal 1, response.to_i
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def test_competitors_de
|
56
|
+
VCR.use_cassette('competitors_de') do
|
57
|
+
category_id = 135
|
58
|
+
geo = "53.66,10.1154"
|
59
|
+
response = $client.competitors(category_id, geo).response.first.id
|
60
|
+
assert_equal 282, response.to_i
|
61
|
+
end
|
62
|
+
end
|
47
63
|
end
|
@@ -0,0 +1,140 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.apphera.com/1/categories?api_key=63ad4581c8746c06b511b3fe50f4ace5&country=de
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers: {}
|
10
|
+
response:
|
11
|
+
status:
|
12
|
+
code: 200
|
13
|
+
message: OK
|
14
|
+
headers:
|
15
|
+
Server:
|
16
|
+
- nginx/1.2.1
|
17
|
+
Date:
|
18
|
+
- Fri, 03 Aug 2012 01:08:14 GMT
|
19
|
+
Content-Type:
|
20
|
+
- application/json; charset=utf-8
|
21
|
+
Content-Length:
|
22
|
+
- '9964'
|
23
|
+
Connection:
|
24
|
+
- keep-alive
|
25
|
+
Status:
|
26
|
+
- 200 OK
|
27
|
+
X-Ua-Compatible:
|
28
|
+
- IE=Edge,chrome=1
|
29
|
+
Etag:
|
30
|
+
- ! '"7774294eb59ae04431afe8df1614b699"'
|
31
|
+
Cache-Control:
|
32
|
+
- max-age=0, private, must-revalidate
|
33
|
+
X-Request-Id:
|
34
|
+
- df2736ee95c001c7071a6ea27fc6a58b
|
35
|
+
X-Runtime:
|
36
|
+
- '0.195190'
|
37
|
+
X-Rack-Cache:
|
38
|
+
- miss
|
39
|
+
body:
|
40
|
+
encoding: UTF-8
|
41
|
+
string: ! '{"response":[{"id":2,"name":"Autoglas"},{"id":3,"name":"Autoh\u00e4user"},{"id":4,"name":"Autolackierer"},{"id":5,"name":"Autoleasing"},{"id":6,"name":"Autoschrotthandel"},{"id":7,"name":"Autotuning"},{"id":9,"name":"Fahrschulen"},{"id":10,"name":"Fahrzeugbau"},{"id":11,"name":"Flughafentransfer"},{"id":15,"name":"Motorr\u00e4der"},{"id":16,"name":"Nutzfahrzeuge"},{"id":17,"name":"Oldtimer"},{"id":18,"name":"Parkh\u00e4user"},{"id":19,"name":"Reifendienste"},{"id":20,"name":"Schrotthandel"},{"id":21,"name":"Tankstellen"},{"id":22,"name":"Vermietung"},{"id":23,"name":"Waschanlagen"},{"id":24,"name":"Werkst\u00e4tten"},{"id":25,"name":"Abbruchunternehmen
|
42
|
+
"},{"id":26,"name":"Bauhandwerk"},{"id":27,"name":"Baumaschinen"},{"id":28,"name":"Bauplanung"},{"id":29,"name":"Baustoffe"},{"id":30,"name":"Hallenbau
|
43
|
+
"},{"id":31,"name":"Montagearbeiten "},{"id":32,"name":"Restaurierung "},{"id":33,"name":"Sanierung
|
44
|
+
"},{"id":34,"name":"Stuckateure "},{"id":35,"name":"Abfallwirtschaft"},{"id":36,"name":"Altenheime
|
45
|
+
"},{"id":37,"name":"Altenpflege "},{"id":38,"name":"Bestattungen"},{"id":40,"name":"Jugendeinrichtungen
|
46
|
+
"},{"id":41,"name":"Mediation "},{"id":42,"name":"Notdienste"},{"id":44,"name":"Seniorenwohnungen
|
47
|
+
"},{"id":46,"name":"Sozialdienste"},{"id":47,"name":"Stadtarchiv "},{"id":48,"name":"Stiftungen
|
48
|
+
"},{"id":49,"name":"Supervision "},{"id":50,"name":"Verbraucherzentralen "},{"id":51,"name":"Wasser"},{"id":52,"name":"Wohnungs-
|
49
|
+
und Zimmervermittlung "},{"id":56,"name":"Arbeitssicherheit "},{"id":57,"name":"Arbeitsvermittlung
|
50
|
+
"},{"id":58,"name":"Berufliche Weiterbildung "},{"id":59,"name":"Berufsbildende
|
51
|
+
Schulen "},{"id":60,"name":"Berufsbildung "},{"id":61,"name":"Berufsgenossenschaften"},{"id":62,"name":"Bildungseinrichtungen
|
52
|
+
"},{"id":63,"name":"Computerschulung "},{"id":64,"name":"Erwachsenenbildung
|
53
|
+
"},{"id":66,"name":"Fahrschulen "},{"id":67,"name":"Flugschulen "},{"id":68,"name":"Hochschulen
|
54
|
+
"},{"id":69,"name":"Nachhilfeunterricht "},{"id":70,"name":"Personalberatung
|
55
|
+
"},{"id":71,"name":"Privatschulen "},{"id":72,"name":"Schulen"},{"id":73,"name":"Schulverwaltungsamt
|
56
|
+
"},{"id":74,"name":"Sportschulen "},{"id":75,"name":"Sprachschulen "},{"id":76,"name":"Zeitarbeit"},{"id":78,"name":"Computer
|
57
|
+
Service"},{"id":79,"name":"EDV "},{"id":80,"name":"Internet "},{"id":81,"name":"Internet-Caf\u00e9s
|
58
|
+
"},{"id":82,"name":"Kommunikation und Netzwerke "},{"id":83,"name":"Software
|
59
|
+
"},{"id":84,"name":"Web-Design "},{"id":85,"name":"Apotheken "},{"id":86,"name":"Blutspendedienste
|
60
|
+
"},{"id":88,"name":"Heilpraktiker"},{"id":89,"name":"Hilfsdienste "},{"id":90,"name":"H\u00f6rger\u00e4te
|
61
|
+
"},{"id":91,"name":"Krankenh\u00e4user"},{"id":92,"name":"Laborbedarf "},{"id":93,"name":"Labordiagnostik
|
62
|
+
"},{"id":95,"name":"Medizinischer Fachbedarf "},{"id":96,"name":"Optiker"},{"id":98,"name":"Osteopathie
|
63
|
+
"},{"id":99,"name":"Pflegedienste"},{"id":100,"name":"Physiotherapie"},{"id":101,"name":"Psychiatrie
|
64
|
+
und Psychotherapie"},{"id":102,"name":"Reformh\u00e4user "},{"id":103,"name":"Rehabilitation"},{"id":105,"name":"Schwangerschaft
|
65
|
+
und Geburt"},{"id":106,"name":"Suchtberatung "},{"id":107,"name":"Zahnmedizin"},{"id":108,"name":"\u00c4rzte"},{"id":109,"name":"Bar"},{"id":111,"name":"Caf\u00e9s
|
66
|
+
"},{"id":112,"name":"Catering"},{"id":113,"name":"Eiscaf\u00e9s "},{"id":114,"name":"Feinkost
|
67
|
+
"},{"id":115,"name":"Fleischereien "},{"id":117,"name":"Konditoreien "},{"id":118,"name":"Lebensmittel
|
68
|
+
"},{"id":119,"name":"Lieferservices "},{"id":120,"name":"Meeresfr\u00fcchte
|
69
|
+
"},{"id":122,"name":"Pubs / Kneipen "},{"id":123,"name":"Restaurants"},{"id":124,"name":"S\u00fc\u00dfwaren
|
70
|
+
"},{"id":125,"name":"Tiefk\u00fchlkost "},{"id":126,"name":"Bierg\u00e4rten
|
71
|
+
"},{"id":127,"name":"Bistro "},{"id":128,"name":"Erlebnisgastronomie "},{"id":130,"name":"Pizza
|
72
|
+
"},{"id":131,"name":"Restaurant: Amerikanisch "},{"id":132,"name":"Restaurant:
|
73
|
+
Arabisch "},{"id":133,"name":"Restaurant: Asiatisch "},{"id":134,"name":"Restaurant:
|
74
|
+
Brasilianisch "},{"id":135,"name":"Restaurant: Chinesisch "},{"id":136,"name":"Restaurant:
|
75
|
+
Deutsch "},{"id":137,"name":"Restaurant: Fisch "},{"id":141,"name":"Restaurant:
|
76
|
+
Griechisch "},{"id":142,"name":"Restaurant: Indisch "},{"id":144,"name":"Restaurant:
|
77
|
+
Italienisch "},{"id":145,"name":"Restaurant: Japanisch "},{"id":146,"name":"Restaurant:
|
78
|
+
Koreanisch "},{"id":147,"name":"Restaurant: Kroatisch "},{"id":148,"name":"Restaurant:
|
79
|
+
Libanesisch "},{"id":149,"name":"Restaurant: Mediterran "},{"id":150,"name":"Restaurant:
|
80
|
+
Mexikanisch "},{"id":151,"name":"Restaurant: Polnisch "},{"id":152,"name":"Restaurant:
|
81
|
+
Portugiesisch "},{"id":153,"name":"Restaurant: Russisch "},{"id":154,"name":"Restaurant:
|
82
|
+
Spanisch "},{"id":155,"name":"Restaurant: Steakhaus "},{"id":156,"name":"Restaurant:
|
83
|
+
Thail\u00e4ndisch "},{"id":157,"name":"Restaurant: Tibetisch "},{"id":158,"name":"Doener
|
84
|
+
Restaurant"},{"id":159,"name":"Restaurant: Vegetarisch "},{"id":160,"name":"Restaurant:
|
85
|
+
Vietnamesisch "},{"id":161,"name":"Restaurant: verschiedene "},{"id":162,"name":"Schnellrestaurants
|
86
|
+
"},{"id":163,"name":"Anlageberatung"},{"id":164,"name":"Banken"},{"id":165,"name":"Beteiligungsgesellschaften
|
87
|
+
"},{"id":167,"name":"Finanzbuchhaltung "},{"id":168,"name":"Finanzierungsunternehmen
|
88
|
+
"},{"id":169,"name":"Immobilien"},{"id":170,"name":"Kassensysteme "},{"id":171,"name":"Kundendienste
|
89
|
+
"},{"id":172,"name":"Leasing "},{"id":174,"name":"Schulden"},{"id":175,"name":"Steuerberater
|
90
|
+
"},{"id":176,"name":"Unternehmensberatung "},{"id":177,"name":"Versicherungen"},{"id":179,"name":"Anglerbedarf
|
91
|
+
"},{"id":180,"name":"Ballonfahrten "},{"id":181,"name":"Billard "},{"id":182,"name":"Boote"},{"id":183,"name":"Bowlingbahnen
|
92
|
+
"},{"id":184,"name":"Camping"},{"id":185,"name":"Fahrr\u00e4der"},{"id":187,"name":"Golf
|
93
|
+
"},{"id":188,"name":"Hobby"},{"id":189,"name":"Inlineskating "},{"id":190,"name":"Jagdbedarf
|
94
|
+
"},{"id":191,"name":"Reiten "},{"id":192,"name":"Schwimmb\u00e4der "},{"id":193,"name":"Spielpl\u00e4tze
|
95
|
+
"},{"id":194,"name":"Sportanlagen "},{"id":195,"name":"Sportbedarf "},{"id":196,"name":"Tanzen"},{"id":197,"name":"Tauchsport
|
96
|
+
"},{"id":198,"name":"Tennis "},{"id":199,"name":"Vereine "},{"id":200,"name":"Wassersport
|
97
|
+
"},{"id":201,"name":"Wettb\u00fcros "},{"id":203,"name":"Kunst"},{"id":204,"name":"Erotik
|
98
|
+
"},{"id":205,"name":"Film"},{"id":207,"name":"Kultur "},{"id":208,"name":"Kunstgewerbe
|
99
|
+
"},{"id":209,"name":"Model- und Castingagenturen "},{"id":210,"name":"Museen
|
100
|
+
"},{"id":211,"name":"Musik"},{"id":212,"name":"Nachtclubs "},{"id":213,"name":"Radio-
|
101
|
+
und Fernsehsender "},{"id":214,"name":"Schaupl\u00e4tze"},{"id":215,"name":"Theater
|
102
|
+
"},{"id":216,"name":"Ticketverkauf "},{"id":217,"name":"Veranstaltungsservice
|
103
|
+
"},{"id":218,"name":"Autogenes Training "},{"id":219,"name":"Drogeriewaren
|
104
|
+
"},{"id":221,"name":"Hautpflege "},{"id":222,"name":"Kosmetikstudios & Friseursalons"},{"id":224,"name":"Nagelpflege"},{"id":226,"name":"Piercing
|
105
|
+
& Tatoo"},{"id":227,"name":"Saunab\u00e4der "},{"id":228,"name":"Sonnenstudios
|
106
|
+
"},{"id":229,"name":"Yoga "},{"id":230,"name":"Antennen- und Satellitenbau"},{"id":231,"name":"Bad
|
107
|
+
Sanit\u00e4r"},{"id":232,"name":"Bau"},{"id":233,"name":"Baumpflege "},{"id":234,"name":"Baumschule
|
108
|
+
"},{"id":235,"name":"Baum\u00e4rkte "},{"id":236,"name":"Brennstoffe "},{"id":237,"name":"Garagen"},{"id":238,"name":"Gartenbau
|
109
|
+
"},{"id":239,"name":"Gartencenter "},{"id":242,"name":"Hausdienstleistungen
|
110
|
+
"},{"id":244,"name":"Haussicherheit"},{"id":245,"name":"Haustechnik "},{"id":246,"name":"Inneneinrichtung"},{"id":247,"name":"Klimatechnik
|
111
|
+
"},{"id":248,"name":"Lagerung & Beseitigung"},{"id":249,"name":"Naturwaren
|
112
|
+
"},{"id":250,"name":"Reinigung"},{"id":251,"name":"Schleifereien "},{"id":252,"name":"Steinmetzbetriebe
|
113
|
+
"},{"id":253,"name":"Terrasse & Balkon"},{"id":254,"name":"Tore & Z\u00e4une"},{"id":255,"name":"Treppen
|
114
|
+
und Aufz\u00fcge"},{"id":256,"name":"Versorgung"},{"id":257,"name":"Werkzeuge
|
115
|
+
"},{"id":258,"name":"Ferienh\u00e4user "},{"id":259,"name":"G\u00e4steh\u00e4user
|
116
|
+
"},{"id":260,"name":"Hotels "},{"id":261,"name":"Jugendherbergen "},{"id":263,"name":"Pensionen
|
117
|
+
"},{"id":265,"name":"Reiseveranstalter "},{"id":266,"name":"Busbetriebe "},{"id":267,"name":"Flughafen
|
118
|
+
"},{"id":268,"name":"Kurierdienste "},{"id":269,"name":"Logistik "},{"id":270,"name":"Mitfahrzentrale
|
119
|
+
"},{"id":271,"name":"Schifffahrt "},{"id":272,"name":"Schwertransporte "},{"id":273,"name":"Speditionsgewerbe"},{"id":274,"name":"Taxi-
|
120
|
+
und Mietwagenverkehr "},{"id":275,"name":"Verkehrsbetriebe "},{"id":276,"name":"Verkehrstechnik
|
121
|
+
"},{"id":277,"name":"Copyshop "},{"id":278,"name":"Drucken und Laminieren"},{"id":279,"name":"Foto
|
122
|
+
"},{"id":280,"name":"Grafikdesign "},{"id":281,"name":"Kommunikation"},{"id":282,"name":"Lichtwerbung,
|
123
|
+
Schilder und Stempel"},{"id":283,"name":"Marktforschung "},{"id":284,"name":"Medien-
|
124
|
+
und Werbetechnik "},{"id":285,"name":"Verlagswesen "},{"id":286,"name":"Werbeartikel
|
125
|
+
"},{"id":287,"name":"Werbung, Promotion und Marketing "},{"id":288,"name":"Zeitungen
|
126
|
+
und Zeitschriften"},{"id":289,"name":"Aquaristik "},{"id":290,"name":"Facharzt
|
127
|
+
f\u00fcr Tiermedizin "},{"id":291,"name":"Haustierpflege "},{"id":292,"name":"Imkereien
|
128
|
+
"},{"id":293,"name":"Tierfriedhof "},{"id":294,"name":"Tierheim "},{"id":295,"name":"Tierpensionen
|
129
|
+
"},{"id":296,"name":"Tierschulen "},{"id":297,"name":"Tierzucht "},{"id":299,"name":"Allgemeiner
|
130
|
+
Einzelhandel "},{"id":301,"name":"Automaten "},{"id":302,"name":"Babyausstattung
|
131
|
+
"},{"id":303,"name":"Blumen "},{"id":304,"name":"B\u00fccher"},{"id":305,"name":"Eisenwaren
|
132
|
+
"},{"id":306,"name":"Elektronik"},{"id":307,"name":"Geschenkartikel"},{"id":308,"name":"Hobby
|
133
|
+
und Freizeit"},{"id":309,"name":"Hochzeit und Party"},{"id":310,"name":"Kaufh\u00e4user"},{"id":311,"name":"Kioske
|
134
|
+
"},{"id":312,"name":"Kleidung und Mode"},{"id":314,"name":"Lederwaren "},{"id":315,"name":"Schmuck"},{"id":316,"name":"Schuhe
|
135
|
+
"},{"id":317,"name":"Schulbedarf "},{"id":318,"name":"Spielwaren "},{"id":319,"name":"Tabakwaren
|
136
|
+
"},{"id":320,"name":"Textilien "},{"id":322,"name":"Uhren "},{"id":324,"name":"Zoohandlungen
|
137
|
+
"}],"count":280}'
|
138
|
+
http_version:
|
139
|
+
recorded_at: Fri, 03 Aug 2012 01:08:14 GMT
|
140
|
+
recorded_with: VCR 2.2.4
|
@@ -0,0 +1,82 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.apphera.com/1/organizations?api_key=63ad4581c8746c06b511b3fe50f4ace5&cat_id=135&geo=53.66,10.1154
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers: {}
|
10
|
+
response:
|
11
|
+
status:
|
12
|
+
code: 200
|
13
|
+
message: OK
|
14
|
+
headers:
|
15
|
+
Server:
|
16
|
+
- nginx/1.2.1
|
17
|
+
Date:
|
18
|
+
- Fri, 03 Aug 2012 01:10:33 GMT
|
19
|
+
Content-Type:
|
20
|
+
- application/json; charset=utf-8
|
21
|
+
Content-Length:
|
22
|
+
- '3643'
|
23
|
+
Connection:
|
24
|
+
- keep-alive
|
25
|
+
Status:
|
26
|
+
- 200 OK
|
27
|
+
X-Ua-Compatible:
|
28
|
+
- IE=Edge,chrome=1
|
29
|
+
Etag:
|
30
|
+
- ! '"0a3c74345a84e27944070ba3bc6309b6"'
|
31
|
+
Cache-Control:
|
32
|
+
- max-age=0, private, must-revalidate
|
33
|
+
X-Request-Id:
|
34
|
+
- a900d5d56ccb5e746eabc8c4dd7b0f72
|
35
|
+
X-Runtime:
|
36
|
+
- '0.081388'
|
37
|
+
X-Rack-Cache:
|
38
|
+
- miss
|
39
|
+
body:
|
40
|
+
encoding: UTF-8
|
41
|
+
string: ! '{"response":[{"id":282,"name":"Shin Shin","distance":0.000114539413635058,"street":"Saseler
|
42
|
+
Chaussee 254","postalcode":"20249","city":"Hamburg","phone":"123123123"},{"id":33536,"name":"Shin-shin
|
43
|
+
- China Restaurant Restaurant","distance":0.00490648623804628,"street":"Saseler
|
44
|
+
Chaussee 254","postalcode":"22393","city":"Hamburg","phone":"(0 40) 6 01 11
|
45
|
+
86"},{"id":33392,"name":"Chinatown Dragon","distance":1.30828013244524,"street":"Meiendorfer
|
46
|
+
M\u00fchlenweg 35","postalcode":"22393","city":"Hamburg","phone":"(0 40) 6
|
47
|
+
01 56 63"},{"id":33286,"name":"Zhuo Yi Chinarestaurant","distance":1.37625087693558,"street":"Saseler
|
48
|
+
Chaussee 88A","postalcode":"22391","city":"Hamburg","phone":"(0 40) 63 64
|
49
|
+
66 01"},{"id":33287,"name":"China-Ente Sasel","distance":1.37625087693558,"street":"Saseler
|
50
|
+
Chaussee 88A","postalcode":"22391","city":"Hamburg","phone":"(0 40) 63 29
|
51
|
+
57 71"},{"id":7286,"name":"Canton Chinesisches Restaurant","distance":3.48539809228484,"street":"Bramfelder
|
52
|
+
Chaussee 264","postalcode":"22177","city":"Hamburg","phone":"(0\u00a040)\u00a064\u00a022\u00a025\u00a009"},{"id":32900,"name":"Canton
|
53
|
+
Chinesisches Restaurant","distance":3.48539809228484,"street":"Bramfelder
|
54
|
+
Chaussee 264","postalcode":"22177","city":"Hamburg","phone":"(0 40) 64 22
|
55
|
+
25 09"},{"id":33944,"name":"MAIXIM''s China Restaurant Inh. Wai-Meng Chan","distance":3.73057795960419,"street":"Segeberger
|
56
|
+
Chaussee 273","postalcode":"22851","city":"Norderstedt","phone":"(0 40) 5
|
57
|
+
29 16 28"},{"id":909022,"name":"MAIXIM''s China Restaurant Inh. Wai-Meng Chan","distance":3.73057795960419,"street":"Segeberger
|
58
|
+
Chaussee 273","postalcode":"22851","city":"Norderstedt","phone":"(0 40) 5
|
59
|
+
29 16 28"},{"id":33390,"name":"China Restaurant Happy Palace","distance":3.75495371639956,"street":"Tangstedter
|
60
|
+
Landstr. 244","postalcode":"22417","city":"Hamburg","phone":"(0 40) 5 20 73
|
61
|
+
99"},{"id":33391,"name":"Chinarestaurant Happy Palace","distance":3.75495371639956,"street":"Tangstedter
|
62
|
+
Landstr. 244","postalcode":"22417","city":"Hamburg","phone":"(0 40) 5 20 83
|
63
|
+
88"},{"id":908790,"name":"China Restaurant Happy Palace","distance":3.75495371639956,"street":"Tangstedter
|
64
|
+
Landstr. 244","postalcode":"22417","city":"Hamburg","phone":"(0 40) 5 20 73
|
65
|
+
99"},{"id":908791,"name":"Chinarestaurant Happy Palace","distance":3.75495371639956,"street":"Tangstedter
|
66
|
+
Landstr. 244","postalcode":"22417","city":"Hamburg","phone":"(0 40) 5 20 83
|
67
|
+
88"},{"id":7287,"name":"China Restaurant SHANGHAI","distance":4.13007911827384,"street":"Kleekamp
|
68
|
+
1","postalcode":"22339","city":"Hamburg","phone":"(0\u00a040)\u00a059\u00a066\u00a038"},{"id":32898,"name":"China
|
69
|
+
Restaurant \"SHANGHAI\"","distance":4.13007911827384,"street":"Kleekamp 1","postalcode":"22339","city":"Hamburg","phone":"(0
|
70
|
+
40) 59 66 38"},{"id":33389,"name":"China Restaurant Kwong Restaurant","distance":4.22062110126223,"street":"Schweriner
|
71
|
+
Str. 25","postalcode":"22143","city":"Hamburg","phone":"(0 40) 6 77 59 97"},{"id":33078,"name":"China
|
72
|
+
Restaurant Sea Food","distance":4.34981225413125,"street":"Langenhorner Chaussee
|
73
|
+
131","postalcode":"22415","city":"Hamburg","phone":"(0 40) 32 51 65 56"},{"id":33080,"name":"Chinarestaurant
|
74
|
+
Seafood","distance":4.34981225413125,"street":"Langenhorner Chaussee 131","postalcode":"22415","city":"Hamburg","phone":"(0
|
75
|
+
40) 5 31 72 60"},{"id":908792,"name":"Chinarestaurant Seafood","distance":4.34981225413125,"street":"Langenhorner
|
76
|
+
Chaussee 131","postalcode":"22415","city":"Hamburg","phone":"(0 40) 5 31 72
|
77
|
+
60"},{"id":908793,"name":"China Restaurant Sea Food","distance":4.34981225413125,"street":"Langenhorner
|
78
|
+
Chaussee 131","postalcode":"22415","city":"Hamburg","phone":"(0 40) 32 51
|
79
|
+
65 56"}],"count":20}'
|
80
|
+
http_version:
|
81
|
+
recorded_at: Fri, 03 Aug 2012 01:10:33 GMT
|
82
|
+
recorded_with: VCR 2.2.4
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://api.apphera.com/1/keywords/create?api_key=
|
5
|
+
uri: https://api.apphera.com/1/keywords/create?api_key=63ad4581c8746c06b511b3fe50f4ace5
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: keyword=ruby%20testing
|
@@ -15,7 +15,7 @@ http_interactions:
|
|
15
15
|
Server:
|
16
16
|
- nginx/1.2.1
|
17
17
|
Date:
|
18
|
-
-
|
18
|
+
- Fri, 03 Aug 2012 01:13:49 GMT
|
19
19
|
Content-Type:
|
20
20
|
- application/json; charset=utf-8
|
21
21
|
Content-Length:
|
@@ -27,18 +27,18 @@ http_interactions:
|
|
27
27
|
X-Ua-Compatible:
|
28
28
|
- IE=Edge,chrome=1
|
29
29
|
Etag:
|
30
|
-
- ! '"
|
30
|
+
- ! '"c5e3b3c860ac5edfecd6896a25c801a5"'
|
31
31
|
Cache-Control:
|
32
32
|
- max-age=0, private, must-revalidate
|
33
33
|
X-Request-Id:
|
34
|
-
-
|
34
|
+
- b06d486db3297e990257bb694990abd4
|
35
35
|
X-Runtime:
|
36
|
-
- '0.
|
36
|
+
- '0.190724'
|
37
37
|
X-Rack-Cache:
|
38
38
|
- invalidate, pass
|
39
39
|
body:
|
40
40
|
encoding: UTF-8
|
41
|
-
string: ! '{"response":{"keyword":"ruby testing","id":551,"first_check":"2012-08-
|
41
|
+
string: ! '{"response":{"keyword":"ruby testing","id":551,"first_check":"2012-08-04T01:13:49+00:00"}}'
|
42
42
|
http_version:
|
43
|
-
recorded_at:
|
43
|
+
recorded_at: Fri, 03 Aug 2012 01:13:49 GMT
|
44
44
|
recorded_with: VCR 2.2.4
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.apphera.com/1/keywords?api_key=
|
5
|
+
uri: https://api.apphera.com/1/keywords?api_key=63ad4581c8746c06b511b3fe50f4ace5
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -15,11 +15,11 @@ http_interactions:
|
|
15
15
|
Server:
|
16
16
|
- nginx/1.2.1
|
17
17
|
Date:
|
18
|
-
-
|
18
|
+
- Fri, 03 Aug 2012 01:15:02 GMT
|
19
19
|
Content-Type:
|
20
20
|
- application/json; charset=utf-8
|
21
21
|
Content-Length:
|
22
|
-
- '
|
22
|
+
- '129'
|
23
23
|
Connection:
|
24
24
|
- keep-alive
|
25
25
|
Status:
|
@@ -27,21 +27,19 @@ http_interactions:
|
|
27
27
|
X-Ua-Compatible:
|
28
28
|
- IE=Edge,chrome=1
|
29
29
|
Etag:
|
30
|
-
- ! '"
|
30
|
+
- ! '"513c46deb9a01ae96f6b5079f64a6f4e"'
|
31
31
|
Cache-Control:
|
32
32
|
- max-age=0, private, must-revalidate
|
33
33
|
X-Request-Id:
|
34
|
-
-
|
34
|
+
- 8e3f5810806801f5bb726671de13edcd
|
35
35
|
X-Runtime:
|
36
|
-
- '0.
|
36
|
+
- '0.135976'
|
37
37
|
X-Rack-Cache:
|
38
38
|
- miss
|
39
39
|
body:
|
40
40
|
encoding: UTF-8
|
41
|
-
string: ! '{"response":[{"created_at":"2012-08-
|
42
|
-
|
43
|
-
bubbletea","updated_at":"2012-08-01T06:19:50Z"},{"created_at":"2012-08-01T06:19:50Z","id":550,"name":"berliner
|
44
|
-
bubbletea","updated_at":"2012-08-01T06:19:50Z"}],"count":3}'
|
41
|
+
string: ! '{"response":[{"created_at":"2012-08-01T22:11:58Z","id":551,"name":"ruby
|
42
|
+
testing","updated_at":"2012-08-01T22:11:58Z"}],"count":1}'
|
45
43
|
http_version:
|
46
|
-
recorded_at:
|
44
|
+
recorded_at: Fri, 03 Aug 2012 01:15:02 GMT
|
47
45
|
recorded_with: VCR 2.2.4
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://api.apphera.com/1/sentiments?api_key=
|
5
|
+
uri: https://api.apphera.com/1/sentiments?api_key=63ad4581c8746c06b511b3fe50f4ace5
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: body=I%20love%20ruby&lang=en
|
@@ -15,7 +15,7 @@ http_interactions:
|
|
15
15
|
Server:
|
16
16
|
- nginx/1.2.1
|
17
17
|
Date:
|
18
|
-
-
|
18
|
+
- Fri, 03 Aug 2012 01:12:17 GMT
|
19
19
|
Content-Type:
|
20
20
|
- application/json; charset=utf-8
|
21
21
|
Content-Length:
|
@@ -31,14 +31,14 @@ http_interactions:
|
|
31
31
|
Cache-Control:
|
32
32
|
- max-age=0, private, must-revalidate
|
33
33
|
X-Request-Id:
|
34
|
-
-
|
34
|
+
- 980bbccd677700ea96f12762f6315de3
|
35
35
|
X-Runtime:
|
36
|
-
- '
|
36
|
+
- '18.888677'
|
37
37
|
X-Rack-Cache:
|
38
38
|
- invalidate, pass
|
39
39
|
body:
|
40
40
|
encoding: UTF-8
|
41
41
|
string: ! '{"response":{"polarity":1,"sentiment":0.325}}'
|
42
42
|
http_version:
|
43
|
-
recorded_at:
|
43
|
+
recorded_at: Fri, 03 Aug 2012 01:12:17 GMT
|
44
44
|
recorded_with: VCR 2.2.4
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.apphera.com/1/keywords/550?api_key=
|
5
|
+
uri: https://api.apphera.com/1/keywords/550?api_key=63ad4581c8746c06b511b3fe50f4ace5
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -15,7 +15,7 @@ http_interactions:
|
|
15
15
|
Server:
|
16
16
|
- nginx/1.2.1
|
17
17
|
Date:
|
18
|
-
-
|
18
|
+
- Fri, 03 Aug 2012 01:12:34 GMT
|
19
19
|
Content-Type:
|
20
20
|
- application/json; charset=utf-8
|
21
21
|
Content-Length:
|
@@ -31,9 +31,9 @@ http_interactions:
|
|
31
31
|
Cache-Control:
|
32
32
|
- max-age=0, private, must-revalidate
|
33
33
|
X-Request-Id:
|
34
|
-
-
|
34
|
+
- 78cbb94fc9b6febac04b67d40bcbab72
|
35
35
|
X-Runtime:
|
36
|
-
- '
|
36
|
+
- '0.381999'
|
37
37
|
X-Rack-Cache:
|
38
38
|
- miss
|
39
39
|
body:
|
@@ -52,5 +52,5 @@ http_interactions:
|
|
52
52
|
warnt vor Modegetr\u00e4nk Bubble Tea - Berlin.de","link":"http://www.berlin.de/special/gesundheit-und-beauty/ernaehrung/2523592-215-krankenkasse-warnt-vor-modegetraenk-bubb.html"},{"ranking":11,"link_text":"Bubble
|
53
53
|
Tea in Berlin? (laden, Cafe)","link":"http://www.gutefrage.net/frage/bubble-tea-in-berlin"}],"id":"W7-kbR0gSAi-Ihq3K47HrQ","_score":1.0,"_type":"results","_index":"ranks","_version":null,"sort":null,"highlight":null,"_explanation":null}],"count":1,"pagination":{"previous":null,"next":null,"current":1,"per_page":10,"count":1,"pages":1}}'
|
54
54
|
http_version:
|
55
|
-
recorded_at:
|
55
|
+
recorded_at: Fri, 03 Aug 2012 01:12:34 GMT
|
56
56
|
recorded_with: VCR 2.2.4
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social_media_monitoring
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-08-
|
12
|
+
date: 2012-08-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
@@ -43,7 +43,8 @@ dependencies:
|
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: '0'
|
46
|
-
description: Offers sentiment analysis and
|
46
|
+
description: Offers sentiment analysis,keyword tracking and geographic competitor
|
47
|
+
search
|
47
48
|
email:
|
48
49
|
- niko.manek@gmail.com
|
49
50
|
executables: []
|
@@ -60,6 +61,8 @@ files:
|
|
60
61
|
- lib/social_media_monitoring/version.rb
|
61
62
|
- social_media_monitoring.gemspec
|
62
63
|
- test/client_test.rb
|
64
|
+
- test/fixtures/vcr_cassettes/categories_de.yml
|
65
|
+
- test/fixtures/vcr_cassettes/competitors_de.yml
|
63
66
|
- test/fixtures/vcr_cassettes/create_keyword.yml
|
64
67
|
- test/fixtures/vcr_cassettes/keywords.yml
|
65
68
|
- test/fixtures/vcr_cassettes/sentiment.yml
|
@@ -87,9 +90,11 @@ rubyforge_project:
|
|
87
90
|
rubygems_version: 1.8.24
|
88
91
|
signing_key:
|
89
92
|
specification_version: 3
|
90
|
-
summary: Keyword tracking, sentiment analysis
|
93
|
+
summary: Keyword tracking, sentiment analysis, competitor search
|
91
94
|
test_files:
|
92
95
|
- test/client_test.rb
|
96
|
+
- test/fixtures/vcr_cassettes/categories_de.yml
|
97
|
+
- test/fixtures/vcr_cassettes/competitors_de.yml
|
93
98
|
- test/fixtures/vcr_cassettes/create_keyword.yml
|
94
99
|
- test/fixtures/vcr_cassettes/keywords.yml
|
95
100
|
- test/fixtures/vcr_cassettes/sentiment.yml
|