Skip to content

Instantly share code, notes, and snippets.

@acannistra
Created October 7, 2012 00:45
Show Gist options
  • Save acannistra/3846669 to your computer and use it in GitHub Desktop.
Save acannistra/3846669 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main()
{
string shour, sday, smonth, syear;
string ehour, eday, emonth, eyear;
string yn;
cout << "Start Hour: ";
cin >> shour;
cout << "Start Day: ";
cin >> sday;
cout << "Start Month: ";
cin >> smonth;
cout << "Start Year: ";
cin >> syear;
cout << "End Hour: ";
cin >> ehour;
cout << "Is everything else the same? (y/n): ";
cin >> yn;
if(yn == "y")
{
eday = sday;
emonth = smonth;
eyear = syear;
}
else
{
cout << "End Day: ";
cin >> eday;
cout << "End Month: ";
cin >> emonth;
cout << "End Year: ";
cin >> eyear;
}
cout << "http://wmfo-duke.orgs.tufts.edu/cgi-bin/castbotv2?s-year=" << syear << "&s-month=" << smonth << "&s-day=" << sday << "&s-hour=" << shour << "&e-year=" << eyear << "&e-month=" << emonth << "&e-day=" << eday << "&e-hour=" << ehour<< " Farchive.mp3" << endl;
yn = "n";
cout << "Download to current directory? (y/n): ";
cin >> yn;
if(yn == "y")
{
char quote = '/"';
string temp = "http://wmfo-duke.orgs.tufts.edu/cgi-bin/castbotv2?s-year=" + syear + "&s-month=" + smonth + "&s-day=" + sday + "&s-hour=" + shour + "&e-year=" + eyear + "&e-month=" + emonth + "&e-day=" + eday + "&e-hour=" + ehour + " Farchive.mp3";
string full = "./urldownload.sh \"" + temp + quote;
cout << full << endl;
system(full.c_str());
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment