Giter Site home page Giter Site logo

mkearney / rreddit Goto Github PK

View Code? Open in Web Editor NEW
50.0 6.0 6.0 100 KB

๐ซโŸ‹ Get Reddit data

Home Page: https://github.com/mkearney/rreddit

License: Other

R 100.00%
reddit reddit-api pushshift web-scraping social-media r rstats r-package mkearney-r-package

rreddit's Introduction

rreddit

Build status CRAN status Coverage Status

lifecycle

A package for getting lots of Reddit data.

Installation

Install the development version from Github with:

## install remotes pkg if not already
if (!requireNamespace("remotes")) {
  install.packages("remotes")
}

## install from github
remotes::install_github("mkearney/rreddit")

Use

An example of posts collected from the r/dataisbeautiful subreddit

## get up to 100,000 of the most recent posts made to /r/dataisbeautiful
d <- get_r_reddit("dataisbeautiful", n = 100000)

## aggregate by month and plot the time series
rtweet::ts_plot(dplyr::select(d, created_at = created_utc), "months", trim = 1) +
  tfse::theme_mwk(base_size = 12) +
  ggplot2::ylim(0, NA) +
  ggplot2::labs(
    x = NULL,
    y = NULL,
    title = "Activity on `r/dataisbeautiful` subreddit",
    subtitle = "Monthly number of submissions on r/dataisbeautiful"
  )

rreddit's People

Contributors

emilhvitfeldt avatar mkearney avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

rreddit's Issues

Has the API rate been limited?

I receive 100 rows for the below, with the below message:

u <- get_r_reddit("UraniumSqueeze", n = 300)

โœ” #1: collected 100 posts

Has a limit of 100 been place since this package was written?

Error: lexical error: invalid char in json text

As per the readme after running d <- rreddit::get_r_reddit("dataisbeautiful", n = 100000) getting an error:

Error: lexical error: invalid char in json text.
<!--[if lt IE 7
(right here) ------^

The error occurs randomly after x number of posts retrieved. Usually between 5000 and 10000 posts.

invalid char in json text

Hello,

I'm trying to run the rreddit package but am getting an issue trying to use both get_r_reddit and get_comment_reddit.

The error message when running each time is:

Error: lexical error: invalid char in json text. <!DOCTYPE html> <!--[if lt IE 7 (right here) ------^

I ran the tool fine two weeks ago, and have tried updating the package today but to no success.

Sorry, quite new to R and have tried to do some fixing but nothing I have done so far has worked!

Thanks in advance :)

Error: 'as_tbl' is not an exported object from 'namespace:tbltools' when running the example

I downloaded the package and run the following example from the readme:

library(rreddit)
d <- get_r_reddit("dataisbeautiful", n = 10000)

which gives me Error: 'as_tbl' is not an exported object from 'namespace:tbltools'. Am I missing something?

Here's the output of sessionInfo():

R version 3.5.2 (2018-12-20)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=de_DE.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=de_DE.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=de_DE.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] rreddit_0.0.1 tbltools_0.1.0

loaded via a namespace (and not attached):
[1] compiler_3.5.2 magrittr_1.5 tools_3.5.2 curl_3.3 yaml_2.2.0 jsonlite_1.6

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.