vinepy icon indicating copy to clipboard operation
vinepy copied to clipboard

Add more examples

Open davoclavo opened this issue 10 years ago • 17 comments

As the title says, add more examples!

davoclavo avatar Jan 17 '15 02:01 davoclavo

:+1: I was going to mention this last week too.

I can handle some of this and turn my code into example code.

cdchan avatar Jan 20 '15 17:01 cdchan

do you have some documentation on the use of the wrapper?

dezmaeth avatar Mar 05 '15 22:03 dezmaeth

@dezmaeth I don't have any written yet, but is there something specific you need help with?

cdchan avatar Mar 05 '15 22:03 cdchan

i need to get posible vines using certain keywords o tags

dezmaeth avatar Mar 06 '15 00:03 dezmaeth

what parameters require the "search_tags" method?

dezmaeth avatar Mar 06 '15 00:03 dezmaeth

@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.

cdchan avatar Mar 06 '15 04:03 cdchan

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

davoclavo avatar Mar 06 '15 15:03 davoclavo

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)?

dezmaeth avatar Mar 12 '15 11:03 dezmaeth

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)

davoclavo avatar Mar 12 '15 18:03 davoclavo

how do i post likes back to a post_id, is there any example of your module syntax?

chrism91 avatar Jun 30 '15 18:06 chrism91

@chrism91 you want an example to like a post or what do you mean by "post likes back to a post_id"?

davoclavo avatar Jun 30 '15 18:06 davoclavo

@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.

chrism91 avatar Jun 30 '15 18:06 chrism91

@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 avatar Jun 30 '15 21:06 chrism91

@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)

davoclavo avatar Jun 30 '15 23:06 davoclavo

@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

davoclavo avatar Jun 30 '15 23:06 davoclavo

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 ;)

chrism91 avatar Jul 14 '15 00:07 chrism91

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!

davoclavo avatar Jul 14 '15 01:07 davoclavo