#include <Reddit.h>
An object to represent a Reddit post, used along with the Reddit data source.
This is a convenience class provided for users who wish to use this data source as part of their application. It provides an API that makes it easy to access the attributes of this data set.
The Reddit object is typically not created by a student but rather obtained from calling bridges::DataSource::getRedditData().
Refer to tutorial for example of using this feature: https://bridgesuncc.github.io/tutorials/Data_Reddit.html
- Author
- Erik Saule
- Date
- 7/12/22
◆ Reddit()
bridges::dataset::Reddit::Reddit |
( |
| ) |
|
|
default |
◆ getAuthor()
std::string bridges::dataset::Reddit::getAuthor |
( |
| ) |
const |
|
inline |
@brief return the author of the reddit post
- Returns
- author's username
◆ getCommentCount()
int bridges::dataset::Reddit::getCommentCount |
( |
| ) |
const |
|
inline |
number of comments of the reddit post
- Returns
- number of comments
◆ getID()
std::string bridges::dataset::Reddit::getID |
( |
| ) |
const |
|
inline |
@brief return id of the reddit post
- Returns
- id
◆ getPostTime()
int bridges::dataset::Reddit::getPostTime |
( |
| ) |
const |
|
inline |
time the post was made (UNIX time)
- Returns
- unix time
◆ getScore()
int bridges::dataset::Reddit::getScore |
( |
| ) |
const |
|
inline |
@brief return the score (upvotes - downvotes) of the reddit post
- Returns
- score (upvotes - downvotes)
◆ getSubreddit()
std::string bridges::dataset::Reddit::getSubreddit |
( |
| ) |
const |
|
inline |
name of the subreddit the post appeared in
- Returns
- subreddit name
◆ getText()
std::string bridges::dataset::Reddit::getText |
( |
| ) |
const |
|
inline |
returns the text of the reddit post.
The text of the reddit post. Often in markdown format.
The text could be empty if the reddit post is just a link to a video or an article
- Returns
- full text of the reddit post
◆ getTitle()
std::string bridges::dataset::Reddit::getTitle |
( |
| ) |
const |
|
inline |
@brief return the title of the reddit post
- Returns
- title
◆ getURL()
std::string bridges::dataset::Reddit::getURL |
( |
| ) |
const |
|
inline |
URL associated with the post.
This could be the url of the reddit post itself or the URL of an associated article/video
- Returns
- URL
◆ getVoteRatio()
float bridges::dataset::Reddit::getVoteRatio |
( |
| ) |
const |
|
inline |
ratio of upvotes to downvotes of the reddit post
- Returns
- vote ratio
◆ setAuthor()
void bridges::dataset::Reddit::setAuthor |
( |
string |
auth | ) |
|
|
inline |
◆ setCommentCount()
void bridges::dataset::Reddit::setCommentCount |
( |
int |
cnt | ) |
|
|
inline |
◆ setID()
void bridges::dataset::Reddit::setID |
( |
std::string |
i | ) |
|
|
inline |
◆ setPostTime()
void bridges::dataset::Reddit::setPostTime |
( |
int |
pt | ) |
|
|
inline |
◆ setScore()
void bridges::dataset::Reddit::setScore |
( |
int |
sc | ) |
|
|
inline |
◆ setSubreddit()
void bridges::dataset::Reddit::setSubreddit |
( |
std::string |
sr | ) |
|
|
inline |
◆ setText()
void bridges::dataset::Reddit::setText |
( |
std::string |
txt | ) |
|
|
inline |
◆ setTitle()
void bridges::dataset::Reddit::setTitle |
( |
std::string |
titl | ) |
|
|
inline |
◆ setURL()
void bridges::dataset::Reddit::setURL |
( |
std::string |
u | ) |
|
|
inline |
◆ setVoteRatio()
void bridges::dataset::Reddit::setVoteRatio |
( |
float |
vr | ) |
|
|
inline |
The documentation for this class was generated from the following file:
- /home/erik/work/bridges/bridges-cxx/src/data_src/Reddit.h