This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
(function() { | |
var divHTML = document.querySelectorAll(".details-open"); | |
divHTML.forEach(function (el) { | |
var preNodes = el.getElementsByTagName("pre"); | |
var outputNode = preNodes[1]; | |
outputNode.outerHTML = "<details open class='output'><summary>Run</summary>" + outputNode.outerHTML + "</details>"; | |
}) | |
})(); | |
(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# start_time: %Y-%m-%dT%H:%M:%SZ | |
# end_time: %Y-%m-%dT%H:%M:%SZ | |
# needs jsonlite and httr | |
# next_token can be obtained from meta$next_token to paginate through results | |
get_tweets <- function(q="",n=10,start_time,end_time,token,next_token=""){ | |
if(n>500){ | |
warning("n too big. Using 500 instead") | |
n <- 500 | |
} | |
if(n<5){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import requests | |
import datetime | |
import math | |
import csv | |
import json | |
import traceback | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Print xaringan slides to PDF | |
#' | |
#' Prints xaringan slides to a PDF file, even complicated slides | |
#' with panelsets or other html widgets or advanced features. | |
#' Requires a local installation of Chrome. | |
#' | |
#' @param input Path to Rmd or html file of xaringan slides. | |
#' @param output_file The name of the output file. If using NULL then | |
#' the output filename will be based on filename for the input file. | |
#' If a filename is provided, a path to the output file can also be provided. |