dbaines / usenet-intranet-php-homepage Goto Github PK
View Code? Open in Web Editor NEWA simple little one-page Intranet homepage I created for my home server that links to SickBeard, CouchPotato, Headphones and SABnzbd.
A simple little one-page Intranet homepage I created for my home server that links to SickBeard, CouchPotato, Headphones and SABnzbd.
I have nginx infront of the various cherrypy services, so 192.168.0.1/sabnzbd for example...
"sickbeardURL" => "$_SERVER[HTTP_HOST]/sickbeard",
Ahh, maybe too slow to fetch for intranet...
<?php if($config['tpg']) :
$TPGImage="intranet/images/tpg.png";
$url = "https://cyberstore.tpg.com.au/your_account/index.php?function=checkaccountusage";
//===Step 1. Fetch the appropriate page==
$useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1";
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
//SSL stuff…
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, '0');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, '0');
// set the target url
curl_setopt($ch, CURLOPT_URL,$url);
//Post 3 parameters – Username, Password, and the Submit Button Value
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'check_username='.$config['tpgUser'].'&password='.$config['tpgPass'].'&Submit=GO%21');
//put result into variable, execute curl,fetch the result and close curl connection
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result= curl_exec ($ch);
curl_close ($ch);
//echo $result . ” was the website response…”;
//===Step 2. Find your download usage in the returned string==
//Gonna assume peak and off-peak are the first ‘Peak’ matches, because I’m lazy
$regexp = "Peak Downloads.+";
if(preg_match_all("/$regexp/i", $result, $matches, PREG_SET_ORDER))
{
$data = $matches[0][0];
}
//Trim the
$data = substr($data, 0, -5);
echo $data;
?>
$url = "https://cyberstore.tpg.com.au/your_account/index.php?function=checkaccountusage";
//===Step 1. Fetch the appropriate page==
$useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1";
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
//SSL stuff…
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, '0');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, '0');
// set the target url
curl_setopt($ch, CURLOPT_URL,$url);
//Post 3 parameters – Username, Password, and the Submit Button Value
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'check_username='.$config['tpgUser'].'&password='.$config['tpgPass'].'&Submit=GO%21');
//put result into variable, execute curl,fetch the result and close curl connection
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result= curl_exec ($ch);
curl_close ($ch);
//echo $result . ” was the website response…”;
//===Step 2. Find your download usage in the returned string==
//Gonna assume peak and off-peak are the first ‘Peak’ matches, because I’m lazy
$regexp = "Peak Downloads.+";
if(preg_match_all("/$regexp/i", $result, $matches, PREG_SET_ORDER))
{
$data = $matches[0][0];
}
//Trim the
$data = substr($data, 0, -5);
echo $data;
endif; ?>
syle.css needs updating
.actionButton.transmission span {background-image: url("images/transmission.png");}
.actionButton.sabnzb,
.actionButton.transmission,
.actionButton.utorrent {clear: left; margin-top: 30px;}
Would it be possible for this to work with nzbget instead of Sab?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.