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 more examples #8

Open
davoclavo opened this issue Jan 17, 2015 · 17 comments
Open

Add more examples #8

davoclavo opened this issue Jan 17, 2015 · 17 comments
Milestone

Comments

@davoclavo
Copy link
Owner

As the title says, add more examples!

@davoclavo davoclavo added this to the 1.0 milestone Jan 17, 2015
@cdchan
Copy link
Contributor

cdchan commented Jan 20, 2015

👍 I was going to mention this last week too.

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

@dezmaeth
Copy link

dezmaeth commented Mar 5, 2015

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

@cdchan
Copy link
Contributor

cdchan commented Mar 5, 2015

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

@dezmaeth
Copy link

dezmaeth commented Mar 6, 2015

i need to get posible vines using certain keywords o tags

@dezmaeth
Copy link

dezmaeth commented Mar 6, 2015

what parameters require the "search_tags" method?

@cdchan
Copy link
Contributor

cdchan commented Mar 6, 2015

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

@davoclavo
Copy link
Owner Author

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

@dezmaeth
Copy link

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

@davoclavo
Copy link
Owner Author

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)

@chrism91
Copy link

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

@davoclavo
Copy link
Owner Author

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

@chrism91
Copy link

@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
Copy link

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

@davoclavo
Copy link
Owner Author

@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 🆘 🚑

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
Copy link
Owner Author

@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

@chrism91
Copy link

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

@davoclavo
Copy link
Owner Author

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!

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

No branches or pull requests

4 participants