whos_using_what 1.0.5 → 1.0.6

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.
@@ -52,12 +52,12 @@ class LinkedinClient < BaseApiClient
52
52
  company_name = company_name.gsub(/\s+/, "+")
53
53
  location = location.gsub(/\s+/, "+")
54
54
 
55
- base_url_tmp = @@base_url
55
+ base_url_tmp = @@base_url.clone
56
56
 
57
57
  url = base_url_tmp <<
58
58
  "people-search:(people:(id,first-name,last-name,public-profile-url,picture-url,headline),num-results)" <<
59
- "?company-name=" << company_name << ",
60
- &location=" << location
59
+ "?company-name=" << company_name << "," <<
60
+ "&location=" << location
61
61
 
62
62
  json_api_call_helper url, {}
63
63
 
@@ -39,10 +39,17 @@ class DataPopulators
39
39
  @@companies_searcher = CompaniesSearcher.new @@geo_tagger
40
40
  @@tech_ad_tagger = TechAdTagger.new
41
41
 
42
+ @@mongo_client = MongoHelper.get_mongo_connection
43
+ @@companies_coll = @@mongo_client['companies']
44
+ @@coords_coll = @@mongo_client['coordinates']
45
+
42
46
  #data holders
43
47
  @@facet_location = "us:84"
44
48
  @@programming_languages = ["java", "ruby", "c#", "php", "python", "javascript"]
45
49
 
50
+ @li_config = YAML.load_file(File.expand_path("../../config/linkedin.env", __FILE__))
51
+ @@linkedin_client = LinkedinClient.new @li_config["api_key"], @li_config["api_secret"], @li_config["user_token"], @li_config["user_secret"], @li_config["url"]
52
+
46
53
 
47
54
  end
48
55
 
@@ -100,7 +107,23 @@ class DataPopulators
100
107
 
101
108
  begin
102
109
 
103
- @@geo_tagger.update_companies_with_latitude_longitude
110
+ nearby_companies = @@companies_coll.find().limit(10)
111
+
112
+ nearby_companies.each do |nearby_company|
113
+ raw_results = @@linkedin_client.query_people_from_company nearby_company['name'], "Pleasant Hill, CA"
114
+ people = raw_results['people']['values']
115
+
116
+ limit = 3
117
+ iter = 1
118
+ people.each do |person|
119
+ if iter > limit
120
+ break
121
+ end
122
+ # @results.push person['firstName'] << " " << person['lastName']
123
+ iter += iter
124
+ end
125
+
126
+ end
104
127
 
105
128
  # @@tech_ad_tagger.tag_company_with_technologies @@programming_languages, generate_duckduckgo_url
106
129
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whos_using_what
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: