pat310 / google-trends-api

An API layer on top of google trends
https://www.npmjs.com/package/google-trends-api
MIT License
896 stars 178 forks source link

Proxy option #80

Closed drizzef closed 6 years ago

drizzef commented 7 years ago

Hi,

please review my code and add the option the add proxy. i think the way that i did is not quite "clean" and right. maybe the proxy option should be outside of the properties but it is up to you.

love you module thanks it helped me a lot.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.04%) to 98.077% when pulling 9105f28bc1b692351d3b91797fd8fdd4f13201d7 on drizzef:master into 42a403cbe1c8a91bb7e08668e4def9929c1d68f6 on pat310:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.04%) to 98.077% when pulling 4940f3971e92488937e529b7b2f44a9758372ece on drizzef:master into 42a403cbe1c8a91bb7e08668e4def9929c1d68f6 on pat310:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.04%) to 98.077% when pulling 0d138c6e15134ddf7b9788b160684399049421e2 on drizzef:master into 42a403cbe1c8a91bb7e08668e4def9929c1d68f6 on pat310:master.

pat310 commented 7 years ago

@drizzef Anyway to do this without requiring a dependency?

drizzef commented 7 years ago

Sure, but it will be a bad practice because this lib is already tested very good. But if you want me to do it i will do it.

On 26 Sep 2017, at 2:40, Patrick Trasborg notifications@github.com wrote:

@drizzef https://github.com/drizzef Anyway to do this without requiring a dependency?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pat310/google-trends-api/pull/80#issuecomment-332044268, or mute the thread https://github.com/notifications/unsubscribe-auth/AGCeMywjQ6LhKlwZHK2PypcW4z09Vwc0ks5smDoHgaJpZM4Pi3Iv.

turnerniles commented 7 years ago

@drizzef How do you set up a proxy to forward the request? Also, do you have an array of proxys and the requests are then made from varying proxies?

drizzef commented 7 years ago

there is an Agent that need to be implemented, and yes i found an API with anonymous proxies: https://gimmeproxy.com/#how https://gimmeproxy.com/#how

On 28 Sep 2017, at 0:20, Niles Turner notifications@github.com wrote:

@drizzef https://github.com/drizzef How do you set up a proxy to forward the request? Also, do you have an array of proxys and the requests are then made from varying proxies?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pat310/google-trends-api/pull/80#issuecomment-332658925, or mute the thread https://github.com/notifications/unsubscribe-auth/AGCeM---HvUVz5AAqsGGNv5WGeXwiMRhks5smrwDgaJpZM4Pi3Iv.

Dayjo commented 7 years ago

This is a great idea!

As @pat310 said, it'd be nice to not need another dependency if possible. I also like @turnerniles suggestion of having the ability to use multiple proxies. Perhaps either you could specify which proxy during the request, or set it to 'random'.

The way that I do it at the moment is that I have 5 versions running behind different IPs (using Lambdas), and when my server calls it, it just chooses whichever one has been idle the longest so it seems to get a good rotation and not had any problems being blocked again so far.

pat310 commented 7 years ago

@drizzef I was torn on whether we should include the proxy or not since it is a bit outside the scope of the module; however, there are constantly issues posted about how to increase the quota limit and although this does not completely fix the issue, it would help (like @Dayjo says). I am thinking we should include it.

It might be possible to set it up in a way such that the user can supply their own proxy client, then we don't need to include a dependency and the user can still easily set up a proxy if they choose. Thoughts?

drizzef commented 7 years ago

Hi, you are using in your project the https lib and there is an existing libs that using the Agent in the https lib for redirect the requests to a proxy. so im suggesting the add additional property that pass the agent

On 6 October 2017 at 18:56, Patrick Trasborg notifications@github.com wrote:

@drizzef https://github.com/drizzef I was torn on whether we should include the proxy or not since it is a bit outside the scope of the module; however, there are constantly issues posted about how to increase the quota limit and although this does not completely fix the issue, it would help (like @Dayjo https://github.com/dayjo says). I am thinking we should include it.

It might be possible to set it up in a way such that the user can supply their own proxy client, then we don't need to include a dependency and the user can still easily set up a proxy if they choose. Thoughts?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pat310/google-trends-api/pull/80#issuecomment-334796220, or mute the thread https://github.com/notifications/unsubscribe-auth/AGCeM9t5uZ7EgJ3_Q5LHA806t7fUCwohks5spk2UgaJpZM4Pi3Iv .

-- בברכה, תמיר אוחנה רייבן קידום עסקים ברשת.

pat310 commented 6 years ago

Closed in #92