leadhypebot 1.1 → 1.2
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.
- checksums.yaml +4 -4
- data/lib/leadhypebot.rb +36 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 250a3a064313af0157092ff7b2dbf816d7738b83e50b1ed6ba40fcba7d37f1d6
|
4
|
+
data.tar.gz: b783225e874641a9566b5a56ac9c7ede0db8fd8d53a9ee274655aba8f71fe67e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9187f69df09eb974f176727ca5270e813b612f6b8aea99c954f7e48eacb4c23729677f27426a6239450a55b8178e162387810bef92a037854861f7410bd99b8
|
7
|
+
data.tar.gz: e118b340118bd07df76048eacf17879c61dfdbe25f62a7bc1f6d12b43ced3462e8bfc1308d247aa2ed388de8146addf9c4ecdf66fcc0925e45627b4e1f9c1f38
|
data/lib/leadhypebot.rb
CHANGED
@@ -75,6 +75,41 @@ module BlackStack
|
|
75
75
|
#agent
|
76
76
|
end # def login
|
77
77
|
|
78
|
+
def submit(job_name, sales_navigator_url, l=nil)
|
79
|
+
l = BlackStack::DummyLogger.new(nil) if l.nil?
|
80
|
+
url = 'https://tool.leadhype.com/dashboard/'
|
81
|
+
|
82
|
+
# visit LeadHype history page
|
83
|
+
l.logs "visiting LeadHype dashboard page... "
|
84
|
+
page = self.agent.get(url)
|
85
|
+
l.done
|
86
|
+
|
87
|
+
# send a post request from this page to https://tool.leadhype.com/view/front/controller.php
|
88
|
+
l.logs "sending post request... "
|
89
|
+
page = self.agent.post('https://tool.leadhype.com/view/front/controller.php', {
|
90
|
+
'mode' => '16',
|
91
|
+
'keyword' => job_name,
|
92
|
+
'location' => sales_navigator_url,
|
93
|
+
'keyword_beta_dropdown' => '',
|
94
|
+
'locations' => '',
|
95
|
+
'account' => '',
|
96
|
+
'titles' => '',
|
97
|
+
'isautosalesnavjob' => 'on',
|
98
|
+
'action' => 'addJob'
|
99
|
+
})
|
100
|
+
l.done
|
101
|
+
|
102
|
+
# validate response
|
103
|
+
l.logs "validating response... "
|
104
|
+
h = JSON.parse(page.content)
|
105
|
+
if h['type'] == 'success'
|
106
|
+
l.logf 'success'.green
|
107
|
+
else
|
108
|
+
l.logf 'failed'.red
|
109
|
+
raise 'failed to submit job'
|
110
|
+
end
|
111
|
+
end # def submit
|
112
|
+
|
78
113
|
# getting SalesNavigator jobs from LeadHype.
|
79
114
|
def sales_navigator_jobs(search=nil, status=nil, page=1, l=nil)
|
80
115
|
ret = []
|
@@ -84,7 +119,7 @@ module BlackStack
|
|
84
119
|
# apply filters
|
85
120
|
url += "search=#{CGI.escape(search.to_s)}&"
|
86
121
|
url += "status=#{CGI.escape(status)}&" unless status.nil?
|
87
|
-
|
122
|
+
|
88
123
|
# visit LeadHype history page
|
89
124
|
l.logs "visiting LeadHype history page... "
|
90
125
|
page = self.agent.get(url)
|