I recently wrote several blog posts with many tweets1 as a way of taking notes during the American Society of Human Genetics 2018 conference. A few friends asked me how I did this so fast. The process can be summarized into the following main steps.
Save links of tweets you want to highlight in your post.
Use a hugo-powered blog to obtain the code for embedding tweets easily2.
Proofread, edit and post.
My steps detailed
Here’s the actual process I used.
Identify the conference Twitter hashtag. In my recent case, that was ASHG18.
Create a Google doc or some other simple text file you can access easily from your phone and laptop.
While in a presentation, check the latest tweets for the given hashtag. ASGH18 example.
Copy the link of any tweet you find interesting. If there are none for the session you are in, consider writing some tweets yourself with the conference hashtag!
Paste the link into your Google doc.
Once the day is over, copy-paste the contents of your Google doc into a text editor that has the ability to find and replace using regular expressions. For example, TextMate.
Find and replace to create the syntax for embedding tweets. I’ll cover more of this in detail in the next section.
Find:
https://twitter.com/.*/status/
and replace by:
\n`r blogdown::shortcode(&quot;tweet&quot;, &quot;
Then find:
\?s=[0-9]*
and replace by:
&quot;)`\n
Our file now looks like this:
Add any comments you wish, format the headings and proofread.
Make it public and tweet about your post with the conference hashtag!
And you are done! 🙌🏽🎉
Quick embedding
Note that my blog is powered by blogdown (Xie, Hill, and Thomas, 2017) which has the function blogdown::shortcode() for embedding tweets. For example, blogdown::shortcode(&quot;tweet&quot;, &quot;1054380320533950464&quot;) generates the hugo syntax code which then hugo renders into the tweet itself.
I just completed my #ASHG18 survey @GeneticsSociety. Took a few minutes and most of my feedback wouldn't stand out. Except that I did use a box to suggest having a webinar with role playing scenarios that exemplify how the code of conduct can be used to diffuse harassment @jsdron pic.twitter.com/AKZdnGCr25— 🇲🇽 Dr. Leonardo Collado-Torres (@fellgernon) October 22, 2018
As an alternative, we can use Twitter itself by copy-pasting the code for embedding the tweet directly from the Twitter app/website. On the top right side menu on the tweet itself, select Embed Tweet
then copy-paste the HTML code into your post.
Here’s the code:
I just completed my #ASHG18 survey @GeneticsSociety. Took a few minutes and most of my feedback wouldn't stand out. Except that I did use a box to suggest having a webinar with role playing scenarios that exemplify how the code of conduct can be used to diffuse harassment @jsdron pic.twitter.com/AKZdnGCr25— 🇲🇽 Dr. Leonardo Collado-Torres (@fellgernon) October 22, 2018
and here is how it looks:
I just completed my #ASHG18 survey @GeneticsSociety. Took a few minutes and most of my feedback wouldn't stand out. Except that I did use a box to suggest having a webinar with role playing scenarios that exemplify how the code of conduct can be used to diffuse harassment @jsdron pic.twitter.com/AKZdnGCr25
— 🇲🇽 Dr. Leonardo Collado-Torres (@fellgernon) October 22, 2018
There might be other ways of doing this that are specific to your blog platform.
New to blogdown?
Check:
Emily Zabor’s website tutorial
The blogdown (Xie, Hill, and Thomas, 2017) book.
Alison Presmanes Hill’s blogdown introduction.
Also, ask around. You might belong to a group or know someone that is willing to host a guest post in their blogdown blog. For example:
LIBD rstats club
R-Ladies Baltimore
R-Ladies NYC
Acknowledgements
This blog post was made possible thanks to:
BiocStyle (Oleś, Morgan, and Huber, 2018)
blogdown (Xie, Hill, and Thomas, 2017)
knitcitations (Boettiger, 2017)
sessioninfo (Csárdi, core, Wickham, Chang, et al., 2018)
References
[1] C. Boettiger. knitcitations: Citations for ‘Knitr’ Markdown Files. R package version 1.0.8. 2017. URL: https://CRAN.R-project.org/package=knitcitations.
[2] G. Csárdi, R. core, H. Wickham, W. Chang, et al. sessioninfo: R Session Information. R package version 1.1.0.9000. 2018. URL: https://github.com/r-lib/sessioninfo#readme.
[3] A. Oleś, M. Morgan and W. Huber. BiocStyle: Standard styles for vignettes and other Bioconductor documents. R package version 2.8.2. 2018. URL: https://github.com/Bioconductor/BiocStyle.
[4] Y. Xie, A. P. Hill and A. Thomas. blogdown: Creating Websites with R Markdown. ISBN 978-0815363729. Boca Raton, Florida: Chapman and Hall/CRC, 2017. URL: https://github.com/rstudio/blogdown.
Reproducibility
## ─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────
## setting value ## version R version 3.5.1 Patched (2018-10-14 r75439)
## os macOS High Sierra 10.13.6 ## system x86_64, darwin15.6.0 ## ui X11 ## language (EN) ## collate en_US.UTF-8 ## ctype en_US.UTF-8 ## tz America/New_York ## date 2018-10-24 ## ## ─ Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────
## package * version date lib source ## assertthat 0.2.0 2017-04-11 [1] CRAN (R 3.5.0) ## backports 1.1.2 2017-12-13 [1] CRAN (R 3.5.0) ## bibtex 0.4.2 2017-06-30 [1] CRAN (R 3.5.0) ## BiocStyle * 2.8.2 2018-05-30 [1] Bioconductor ## blogdown 0.8 2018-07-15 [1] CRAN (R 3.5.0) ## bookdown 0.7 2018-02-18 [1] CRAN (R 3.5.0) ## cli 1.0.1 2018-09-25 [1] CRAN (R 3.5.0) ## colorout * 1.2-0 2018-05-03 [1] Github (jalvesaq/colorout@c42088d)
## crayon 1.3.4 2017-09-16 [1] CRAN (R 3.5.0) ## digest 0.6.18 2018-10-10 [1] CRAN (R 3.5.0) ## evaluate 0.12 2018-10-09 [1] CRAN (R 3.5.0) ## htmltools 0.3.6 2017-04-28 [1] CRAN (R 3.5.0) ## httr 1.3.1 2017-08-20 [1] CRAN (R 3.5.0) ## jsonlite 1.5 2017-06-01 [1] CRAN (R 3.5.0) ## knitcitations * 1.0.8 2017-07-04 [1] CRAN (R 3.5.0) ## knitr 1.20 2018-02-20 [1] CRAN (R 3.5.0) ## lubridate 1.7.4 2018-04-11 [1] CRAN (R 3.5.0) ## magrittr 1.5 2014-11-22 [1] CRAN (R 3.5.0) ## plyr 1.8.4 2016-06-08 [1] CRAN (R 3.5.0) ## R6 2.3.0 2018-10-04 [1] CRAN (R 3.5.0) ## Rcpp 0.12.19 2018-10-01 [1] CRAN (R 3.5.1) ## RefManageR 1.2.0 2018-04-25 [1] CRAN (R 3.5.0) ## rmarkdown 1.10 2018-06-11 [1] CRAN (R 3.5.0) ## rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.5.0) ## sessioninfo * 1.1.0.9000 2018-10-02 [1] Github (r-lib/sessioninfo@4f91fad)
## stringi 1.2.4 2018-07-20 [1] CRAN (R 3.5.0) ## stringr 1.3.1 2018-05-10 [1] CRAN (R 3.5.0) ## withr 2.1.2 2018-03-15 [1] CRAN (R 3.5.0) ## xfun 0.3 2018-07-06 [1] CRAN (R 3.5.0) ## xml2 1.2.0 2018-01-24 [1] CRAN (R 3.5.0) ## yaml 2.2.0 2018-07-25 [1] CRAN (R 3.5.0) ## ## [1] /Library/Frameworks/R.framework/Versions/3.5/Resources/library
ASHG18 day 1 post, day 2, day 3, day 4 and day 5.↩
Or any other tool that can get you the embedding code, including the Twitter page itself.↩