huginn_instagram_agent 0.4.4 → 0.5.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.
- checksums.yaml +4 -4
- data/lib/huginn_instagram_agent/instagram_agent.rb +18 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65f3da4dbcef3dd547381760b48047277fb88716099e3c371cd46c61d931126e
|
4
|
+
data.tar.gz: 8c08dfa7ffa98aade1775bd36fe738d38a748f1690c21097c813ce35b6204cbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7eccdb24f4e937f1410490be7a4661ace7cddbd21526fb938e1a669bf121a47a9d94ad1851b0e708be7d21093c0f13ab9b5764e86f11ed0bc457b76994b312fd
|
7
|
+
data.tar.gz: e20c1f2f98c9300968982dcea2ebedd11086f63f28b491a639d80e560a2f8446dddb8029e48818d1c7ae6cadc5f1d42e7831f40b5713b9e6be9bacb7a727298d
|
@@ -10,6 +10,8 @@ module Agents
|
|
10
10
|
It can be scheduled to hit Instagram as much as you want but will obey
|
11
11
|
the `wait_between_refresh` for each account to avoid being banned.
|
12
12
|
If set to `0` it will refresh all accounts at every run.
|
13
|
+
|
14
|
+
You can set the option `proxy` to use one. The format is `user:password@host:port`.
|
13
15
|
|
14
16
|
Links generally expire after 24 hours but this agent will try to keep the
|
15
17
|
corresponding events updated so they can be used in a feed.
|
@@ -33,6 +35,20 @@ module Agents
|
|
33
35
|
end
|
34
36
|
|
35
37
|
|
38
|
+
def proxy
|
39
|
+
return {} if options['proxy'].nil?
|
40
|
+
|
41
|
+
user, password, host, port = options['proxy'].split(/[:@]/)
|
42
|
+
|
43
|
+
return {
|
44
|
+
:http_proxyaddr => host,
|
45
|
+
:http_proxyport => port,
|
46
|
+
:http_proxyuser => user,
|
47
|
+
:http_proxypass => password
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
|
36
52
|
def working?
|
37
53
|
memory['error'] != true
|
38
54
|
end
|
@@ -61,10 +77,10 @@ module Agents
|
|
61
77
|
def get_posts(account)
|
62
78
|
url = "https://www.instagram.com/#{account}/?__a=1&__d=di"
|
63
79
|
|
64
|
-
response = HTTParty.get(url,
|
80
|
+
response = HTTParty.get(url, {
|
65
81
|
:headers => {
|
66
82
|
'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36'
|
67
|
-
}
|
83
|
+
}}.merge(proxy)
|
68
84
|
)
|
69
85
|
|
70
86
|
unless response.success?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: huginn_instagram_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alessio Signorini
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-03-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '0'
|
99
99
|
requirements: []
|
100
|
-
rubygems_version: 3.
|
100
|
+
rubygems_version: 3.4.6
|
101
101
|
signing_key:
|
102
102
|
specification_version: 4
|
103
103
|
summary: Huginn Agent that monitors public Instagram accounts
|