Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- /*-------USTAWIENIA------*/
- $ts3_ip = 'localhost';
- $ts3_queryport = 10011;
- $ts3_user = 'serveradmin';
- $ts3_pass = 'RdBeoeZO';
- $ts3_port = 9987;
- $ts3_defaultchannel = 2;
- $ts3_channel_password = Null;
- $name = "BOT TS3";
- $czas = 2; /* co ile sekund ma aktualizować kanały
- możesz wpisać 60*ilość minut, bądź 3600*ilość godzin
- */
- //$youtube[] = array("nazwa kanału","ID KANAŁU YOUTUBE", ID KANAŁU TEAMSPEAK);
- $youtube[] = array("EwaFarnaVEVO","UCSebDIT3FRWq5lUV61UT6JQ",1);
- /*----------------------*/
- #Include ts3admin.class.php
- require("src/ts3admin.class.php");
- #build a new ts3admin object
- $tsAdmin = new ts3admin($ts3_ip, $ts3_queryport);
- echo "<pre>";
- if($tsAdmin->getElement('success', $tsAdmin->connect())) {
- #login as serveradmin
- $tsAdmin->login($ts3_user, $ts3_pass);
- #select teamspeakserver
- $tsAdmin->selectServer($ts3_port);
- //while (1){
- $tsAdmin->setName($name);
- $tsAdmin->clientMovedbid(1, $ts3_defaultchannel, $ts3_channel_password);
- sleep($czas);
- foreach($youtube as $yter){
- $page = "http://151.80.111.114/subscribeyoutube.php?id=".$yter[1];
- $page = file_get_contents($page);
- $page = json_decode($page, true);
- //$data = "channel_description=viewCount".$page['viewCount'];
- $data_channelname = $yter[0]." (".$page['subscriberCount'].")";
- $data_channeldesc = "[url=https://www.youtube.com/channel/".$yter[1]."]".$yter[0]."[/url] \nSubskrybcji: ".$page['subscriberCount']."\nWyświetleń: ".$page['viewCount']."\nIlość filmów na kanale: ".$page['videoCount'];
- $aktualne = $tsAdmin->channelInfo($yter[2]);
- $aktualnanazwa = $aktualne['data']['channel_name'];
- $aktualnydesc = $aktualne['data']['channel_description'];
- echo "akt: ".$aktualnydesc."\n";
- echo "now: ".$data_channeldesc."\n";
- if($data_channeldesc != $aktualnydesc)
- {
- $data['channel_description'] = $data_channeldesc;
- if($data_channelname != $aktualnanazwa)$data['channel_name'] = $data_channelname;
- else unset($data['channel_name']);
- $tsAdmin->channelEdit(1, $data);
- }
- }
- //}
- }else{
- echo 'Connection could not be established.';
- }
- echo "</pre>";
- /**
- * This code retuns all errors from the debugLog
- */
- if(count($tsAdmin->getDebugLog()) > 0) {
- foreach($tsAdmin->getDebugLog() as $logEntry) {
- echo '<script>alert("'.$logEntry.'");</script>';
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement