Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Loops Endpoint #18

Open
lucaspenchas opened this issue Apr 27, 2016 · 16 comments
Open

Add Loops Endpoint #18

lucaspenchas opened this issue Apr 27, 2016 · 16 comments

Comments

@lucaspenchas
Copy link

Hello, I'd really appreciate if someone can give me an example of how can I use the Loops endpoint as it's not implemented in the 'examples' page.
Thanks!
Lucas

@davoclavo
Copy link
Owner

Loops are not yet supported in this library. I guess you mean submitting a loop count?

@lucaspenchas
Copy link
Author

lucaspenchas commented Apr 28, 2016 via email

@davoclavo
Copy link
Owner

davoclavo commented Apr 28, 2016

Would be happy to help you out submit a pull request.

You'll need to figure out what parameters are sent in the request (probably someone has documented this already). Then you need to add an endpoint to https://github.com/davoclavo/vinepy/blob/master/vinepy/endpoints.py, including all the parameters. And finally, if the response is meaningful, we should add a Model which will be generated with the response body, otherwise leave the endpoint 'model': None'

@lucaspenchas
Copy link
Author

Hi David!
I just changed the endpoints.py file and now it looks like this.
'loops': {
'endpoint': 'loops',
'request_type': 'post',
'url_params': [],
'required_params': ['ts', 'postId', 'count'],
'optional_params': [],
'default_params': [],
'model': None
},

But it gives me this error...
File "build\bdist.win32\egg\vinepy\api.py", line 32, in _inne
File "build\bdist.win32\egg\vinepy\api.py", line 46, in api_c
File "build\bdist.win32\egg\vinepy\api.py", line 155, in do_r
vinepy.errors.VineError: #3: A required parameter is missing.

Thanks!
Lucas

@davoclavo
Copy link
Owner

How are you calling the loops function?

It should be something like: vine.loops(ts=1234, postId='123', count=100)

@lucaspenchas
Copy link
Author

lucaspenchas commented Apr 28, 2016 via email

@lucaspenchas
Copy link
Author

lucaspenchas commented Apr 29, 2016 via email

@davoclavo
Copy link
Owner

It seems it is an error returned by them:

raise VineError(json['code'], json['error'])

Probably there is another required_parameter that has to be sent. How did you figure out you only needed ts, postId, count?

@lucaspenchas
Copy link
Author

lucaspenchas commented Apr 29, 2016 via email

@davoclavo
Copy link
Owner

Ok thanks, it seems that the request has a unique JSON structure, so we need to update the code accordingly. I'll try to make it work this weekend.

@lucaspenchas
Copy link
Author

Ok!
Thank you!
Lucas

@davoclavo
Copy link
Owner

I just updated the endpoints file to add support for this. You should be able to use it like this:

vine.loops(loops=[{'ts': 1462148569.622568, 'count': 1, 'postId': '1333176710954463232'}])

good luck!

@lucaspenchas
Copy link
Author

Hello, it's only submitting 9 loop counts and then it logs the 'Try again later' error. Is there a way to fix this?
Thanks!

@davoclavo
Copy link
Owner

You are probably being rate limited, send requests less often. Make sure to use proper timestamps as well.

@Juniorbouaka
Copy link

Hi, in python I try this :


import vinepy, time
from random import randint as rd
from sys import stdout as title

vine = vinepy.API(username="[email protected]", password="mypass")
vine.loops(loops=[{'ts': 1462148569.622568, 'count': 2000, 'postId': '1333176710954463232'}])


but its not working , you have the solution ?

@Louismariejunior
Copy link

I have a same problem , any solution ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants