Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mkearney/mocktwitter
🐧🐦 Generate HTML pages for Twitter statuses.
https://github.com/mkearney/mocktwitter
html-website mock-website r-package rstats twitter twitter-com
Last synced: 9 days ago
JSON representation
🐧🐦 Generate HTML pages for Twitter statuses.
- Host: GitHub
- URL: https://github.com/mkearney/mocktwitter
- Owner: mkearney
- License: other
- Created: 2018-06-25T20:49:05.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-07-22T17:28:20.000Z (over 6 years ago)
- Last Synced: 2024-11-15T03:12:34.576Z (2 months ago)
- Topics: html-website, mock-website, r-package, rstats, twitter, twitter-com
- Language: HTML
- Homepage: https://github.com/mkearney/mocktwitter
- Size: 1.47 MB
- Stars: 14
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
eval = FALSE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# mocktwitter🐧🐦 Generate HTML pages for Twitter statuses.
## Installation
You can install the current version of mocktwitter from [Github](https://github.com) with:
```{r}
## install from github
devtools::install_github("mkearney/mocktwitter")
```## `mocktwitter_status()`
Use `mocktwitter_status()` with a status URL, status ID, or tweets data returned by [**{rtweet}**](http://rtweet.info) to create a [mock-up of a Twitter status HTML page](htols/readme/ex.html):
```{r}
## (1) URL to twitter status data byrealDonaldTrump
mocktwitter_status("https://twitter.com/realDonaldTrump/status/1010900865602019329")## (2) mockup an HTML twitter page for a readDonaldTrump status
mocktwitter_status("1010900865602019329")## (3) twitter status data from rtweet for a realDonaldTrump tweet
rdt <- rtweet::lookup_statuses("1010900865602019329")## override with custom text
rdt$text <- "Give me your tired, your poor, your huddled masses yearning to breathe free, the wretched refuse of your teeming shore. Send these, the homeless, tempest-tossed to me, I lift my lamp beside the golden door!"## mock-up an HTML twitter page
mocktwitter_status(rdt, file = "tools/readme/ex.html")
```
In Rstudio, a preview will be displayed in the viewer pane.
## `mocktwitter_timeline()` (**dev in progress**)
Use `mocktwitter_timeline()` with a user URL, screen name, user ID, or timeline
data returned by [**{rtweet}**](http://rtweet.info) to create a [mock-up of a Twitter status HTML page](tools/readme/ex2.html):```{r}
## (1) URL to a twitter timeline
mocktwitter_timeline("https://twitter.com/kearneymw")## (2) screen name or user ID of twitter account
mocktwitter_timeline("kearneymw", file = "tools/readme/ex2.html")
```