Automated httr authentication with twitteR , provide response to interactive prompt in batch mode
You can try setting the httr_oauth_cache
option to TRUE:
options(httr_oauth_cache=T)
The twitteR package uses the httr
package, on the Token
manual page for that package they give tips about caching:
OAuth tokens are cached on disk in a file called .httr-oauth
saved in the current working directory. Caching is enabled if:
The session is interactive, and the user agrees to it, OR
The .httr-oauth file is already present, OR
getOption("httr_oauth_cache") is TRUE
You can suppress caching by setting the httr_oauth_cache option to FALSE.
Passing arguments to an interactive program non-interactively
For more complex tasks there is expect
( http://en.wikipedia.org/wiki/Expect ).
It basically simulates a user, you can code a script how to react to specific program outputs and related stuff.
This also works in cases like ssh
that prohibits piping passwords to it.
Automatically answer to input prompt in windows batch
You want this:
echo y | [Command]
Eg: echo y | program.exe
"echo <answer> | <batch command>"
Ex: The del /P command option will prompt for user's confirmation before deleting the file.
So if you are using this option in your batch script, it requires manual input to proceed further.
To avoid this manual input, use the command "echo Y | del /P " in your batch script to answer the prompt.
You can try this echo command to pass input (ex: answer for username and password prompts) to your console application, when it is invoked through batch script.
Refer: http://thirutechie.blogspot.com/2009/10/how-to-auto-answer-prompts-in-windows.html
Related Topics
First Day of the Month from a Posixct Date Time Using Lubridate
Should I Avoid Programming Packages with Pipe Operators
How to Find Common Rows Between Two Dataframe in R
In R, How to Check If Two Variable Names Reference the Same Underlying Object
Change Plotly Chart Y Variable Based on Selectinput
Overlay Geom_Points() on Geom_Boxplot(Fill=Group)
Time Series Plot with X Axis in "Year"-"Month" in R
Legends for Multiple Fills in Ggplot
Dual Y Axis in Ggplot2 for Multiple Panel Figure
Finding Where Two Linear Fits Intersect in R
How to Train a Ml Model in Sparklyr and Predict New Values on Another Dataframe
Find Consecutive Values in Vector in R
Writing Data Frame to PDF Table
How to Return 5 Topmost Values from Vector in R
How to Add Shaded Confidence Intervals to Line Plot with Specified Values