Repository

veddit

a simplistic reddit wrapper for V

WARNING: At the moment, this library only can get data from Reddit's JSON APIs for Posts, and About data.

installation

this project is listed on vpm meaning you are able to pull it into your workspace by simply running v install acelikesghosts.veddit , or you can add it into your v.mod file if you'd like it to be project specific

usage:

a few simplistic applications can be found in the examples folder ,

logging a user's about details is very easy, and can be seen here:

module main

import acelikesghosts.veddit

fn main() {
    about := veddit.about_user('acelikesaudio')!
    // about.whatever
    println('id: ${about.data.id}')

    // to get a user's posts, use the veddit.user_posts_a method
    posts := veddit.user_posts_a('acelikesaudio')!

    // for each child in the data's children
    // or, for each post in the array of posts (children)
    for child in posts.data.children {
        println('"${child.data.title}" at ${child.data.created_utc} UTC (${child.data.permalink})')
    }
}

roadmap:

  • subreddit about
  • subreddit posts
  • user posts
  • user about

licencing:

this project is licenced using the MIT licence, simply just because i do not care. do what you want with this project, use it, modify it, make it your own.

About

0
2
1 year ago

Author

AceLikesGhosts