vinepy
vinepy copied to clipboard
Add more examples
As the title says, add more examples!
:+1: I was going to mention this last week too.
I can handle some of this and turn my code into example code.
do you have some documentation on the use of the wrapper?
@dezmaeth I don't have any written yet, but is there something specific you need help with?
i need to get posible vines using certain keywords o tags
what parameters require the "search_tags" method?
@dezmaeth hmm, sorry, I haven't personally worked with tags. https://github.com/davoclavo/vinepy/blob/master/vinepy/endpoints.py#L414 seems to indicate all you need is tag_name
though.
hey, @dezmaeth you should check out https://github.com/davoclavo/vinepy/blob/master/examples/vine_search.py - it's an example to show the timeline for a specific tag
it works great, is there a way to get more than 20 results? (and is there a way to do a keyword search, not using the tags)?
Yeah, but you would need to handle pagination
Just add the page parameter to the get_tag_timeline
call, like this:
tag_timeline = vine.get_tag_timeline(tag_name='LNV', page=2)
As far as I know, there is no way to search by text, only by tags (#hashtags)
how do i post likes back to a post_id, is there any example of your module syntax?
@chrism91 you want an example to like a post or what do you mean by "post likes back to a post_id"?
@davoclavo yes, sorry. an example to like a post and post a comment. Are there any docs on your module? Just so I don't have to bother you. Would be willing to write one up as well for other users if you could give some examples.
@davoclavo in the endpoints.py file there are several listed that I would like to use, but I don't know the methods in your module. Would you be able to list some here in comments?
@chrism91
Nice source code digging! If you found endpoints.py
, you've pretty much found all the available endpoints. Just play with them and python should spit errors if you are missing arguments.
Also, on the models.py
the api methods are wrapped so you can call like post.like()
without having to specify a post_id
(as it is added automatically, see this)
I'm not sure if this will work (I don't have my computer right now), but you get the gist. Let me know if you need more help :sos: :ambulance:
vine = vinepy.API(username='[email protected]', password='password')
tag_timeline = vine.get_tag_timeline(tag_name='cats')
for post in tag_timeline:
post.like()
# You can call any action that refers to a post
# post.unlike()
# post.revine()
# or you can call any event from the list of endpoints using the API instance
# vine.like(post_id=post.id)
# vine.unlike(post_id=post.id)
# vine.revine(post_id=post.id)
@chrism91 Btw, it would be awesome if you could share your examples, might help other new users! - Would be glad to code review them, give you feedback and add them to the repo
Thanks so much, man! I am willing to write up an api reference doc for all with the same question. But, once I suss out some more of my scripts, id love to post them. Feel free to add them to the repo, just tag me so i can up my github cred ;)
Sweet! I agree, we need to work on the main README adding more examples, documentation, and of course a list of contributors!
Eager to see your scripts!