Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name View cams
- // @namespace None
- // @version 1.3
- // @description View all cams without paying
- // @match http://reallifecam.com/
- // @copyright 2013+, None
- // @require http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
- // ==/UserScript==
- var theElements = document.getElementsByTagName("a");
- var count = 0;
- var camNumber = 0;
- var camID = "";
- var camName = "";
- var clipsDiv = $(".left_column");
- var clipsDiv2 = $(".right_column");
- var newHTML = '<div class="clips">';
- var newHTML2 = '<div class="clips">';
- var cookie = document.cookie;
- var urlraw = readCookie("sign_w");
- var urlSign = cropURL(urlraw);
- for (var i = 0;i < theElements.length; i++)
- {
- var current = theElements[i];
- if(current.id.match("0[0-9]_[0-9]"))
- {
- count++;
- camID = current.id;
- if(current.className.match("cams"))
- {
- //It's a normal cam
- camName = "cam" + camID;
- }
- else
- {
- //It's a passworded cam, presumabley gotta do individual checks here
- camName = "cam" + camID;
- }
- if(count < 20)
- {
- newHTML = newHTML + '<div class="galki-vpravo menu1" onclick="changeclass('+camID+');return false;"><a href="'+camName+'.stream?'+urlSign+'" id="'+camID+'" data-camid="'+camID+'" class=""> Cam #'+camID+'</a></div>';
- }
- else
- {
- newHTML2 = newHTML2 + '<div class="galki-vpravo menu1" onclick="changeclass('+camID+');return false;"><a href="'+camName+'.stream?'+urlSign+'" id="'+camID+'" data-camid="'+camID+'" class=""> Cam #'+camID+'</a></div>';
- }
- }
- }
- //-----This part overrides the old links
- newHTML = newHTML + "</div>";
- newHTML2 = newHTML2 + "</div>";
- clipsDiv.html(newHTML);
- clipsDiv2.html(newHTML2);
- //------------------------
- //-----Console logs for info
- //console.log("Number of Found Links:" + count);
- console.log(urlSign);
- console.log(cookie);
- //-------------
- //Functions used to crop URL and read the cookie for the URL
- function readCookie(name) {
- var nameEQ = name + "=";
- var ca = cookie.split(';');
- for(var i = 0; i < ca.length; i++) {
- var c = ca[i];
- while (c.charAt(0) == ' ') c = c.substring(1, c.length);
- if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
- }
- return null;
- }
- //Cookie Result: sign_w=%3Fkey%3D18ed0Sexpire%3D1377854835Ssign%3Df385fafdda73a2b3224d6e54631db7d7;
- //Link Result: <a href="cam02_1.stream?key=18ed0Sexpire=1377854835Ssign=f385fafdda73a2b3224d6e54631db7d7"
- // So the link is linked with the cookie
- // %3F is a '?'
- // %3D is a '='
- function cropURL(oldurl)
- {
- var splits = oldurl.split("%");
- for(int x=0; x<splits.length; x++)
- {
- if(splits[x].substr(0,3) == "%3F")
- {
- splits[x].substr(0,3) = " ?";
- splits[x].trim();
- }
- else if(splits[x].substr(0,3) == "%3D")
- {
- splits[x].substr(0,3) = " =";
- splits[x].trim();
- }
- }
- var newurl = splits.join("");
- return newurl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement