huginn_instagram_agent 0.4.4 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 645f7e41f1ac78754c549774a4fda0aaee43e8ab8de1e549fba9dc16dde64ebf
4
- data.tar.gz: abcb3c6662524c4d74b3d7a3e8a5e627a64c794f89f44547d9223934b385e770
3
+ metadata.gz: 65f3da4dbcef3dd547381760b48047277fb88716099e3c371cd46c61d931126e
4
+ data.tar.gz: 8c08dfa7ffa98aade1775bd36fe738d38a748f1690c21097c813ce35b6204cbd
5
5
  SHA512:
6
- metadata.gz: 4d52637e2616dccb2f056c7a980103b1a5311d769273cc5abf3223d826fb5fa88cedd02608d470568577f69abbd6c7f002d476018f7ad2eb2cbe254a3bea7c8f
7
- data.tar.gz: e6287bf0fca1623de4147a10114fefbdadbf3ca6a17d6663bfaec5c8f4d3a8c2607752741effd116115e687ad760d6204f8d71c5f855c1390b0a9845fd1d8b90
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.4
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: 2022-12-19 00:00:00.000000000 Z
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.1.4
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