Advertisement
Papadopolis

Untitled

Nov 24th, 2012
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name           O.E. 13/10/11 (Script sem nome)
  3. // @version        0.1 Beta
  4. // @description    Notificador de novos tópicos da comunidade Orkut Exploits.
  5. // @icon           none
  6.  
  7. // @namespace      http://x470.com
  8. // @author         Pedro Prata L. Papadópolis
  9.  
  10. // @include        https://*.orkut.com.br/Main*
  11. // @match          https://*.orkut.com/Main*
  12. // @match          https://*.orkut.co.in/Main*
  13. // @match          http://*.orkut.com/Main*
  14. // @match          http://*.orkut.co.in/Main*
  15. // @match          http://*.orkut.com.br/Main*
  16. // ==/UserScript==
  17.  
  18. // // @require        http://x470.com/oe131011_update.js
  19. _ini = false;
  20.  
  21. if(!_ini) {
  22.     ___$ = [];
  23.    
  24.     ___$.push(document.createElement("style"));
  25.     with(___$[(___$.length)-1]) {
  26.         media       = "screen";
  27.         rel         = "stylesheet";
  28.         type        = "text/css";
  29.         innerHTML   = ' \
  30.            #_papa { \
  31.                bottom: 0; \
  32.                margin-bottom: -3px; \
  33.                position: fixed; \
  34.                right: 50px; \
  35.                background-color: white; \
  36.            } \
  37.            ._titulo { \
  38.                background-color: #888888; \
  39.                border-radius: 1px 1px 0 0; \
  40.                color: white; \
  41.                font-size: 12.5px; \
  42.                padding: 3px 15px; \
  43.                text-align: center; \
  44.            } \
  45.            #_corpo { \
  46.                background-color: white; \
  47.                border-radius: 0 0 2px 2px; \
  48.                padding: 4px; \
  49.            } \
  50.            #_link { \
  51.                color: #666666; \
  52.                text-decoration: none; \
  53.                font-size: 11px; \
  54.            } \
  55.        \ '
  56.     }
  57.    
  58.     ___$.push(document.createElement("div"));
  59.     with(___$[(___$.length)-1]) {
  60.         id      = "_papa";
  61.         innerHTML = ' \
  62.        <a id="_titulo" onclick="_papa()" href="javascript:;"> \
  63.            <div class="_titulo" id="__titulo"><span id="_cmmTitulo">Carregando...</span> <span id="_novos"></span> </div> \
  64.        </a> \
  65.        <div id="_corpo" style="display: none;">Carregando...</div> \
  66.        \ ';
  67.     }
  68.    
  69.     ___$.push(document.createElement("script"));
  70.     with(___$[(___$.length)-1]) {
  71.         type        = "text/javascript";
  72.         innerHTML   = '\
  73.            function I(x) {return document.getElementById(x)} \
  74.            \
  75.            var cmm     = 82433397; \
  76.            var RE1     = /tid\\=\\d+\\n">.*\\n.*\\n<.*\\n.*\\n.*\\n.*\\n.*\\n.*\\n.*\\n.*\\n.*\\n.*\\n.*/g; \
  77.            var RE2     = /tid\\=(\\d+)\\n">.*\\n(.*)\\n<.*\\n.*\\n.*\\n.*\\n.*\\n.*\\n.*?>(\\d+)<.*\\n.*\\n(.*)/; \
  78.            var RE3     = /cmm\\=\\d+"><b>(.*?)<\\/b>/; \
  79.            var _x      = false; \
  80.            var l       = null; \
  81.            var k       = null; \
  82.            var cor1    = "#ffffcc"; \
  83.            var cor2    = "#ffffff"; \
  84.            var T       = []; \
  85.            var G       = true; \
  86.            \
  87.            if(document.cookie.search(/_papa=/i) !== -1) { \
  88.                C = document.cookie.match(/_papa=(.*?;|.*)/i)[1]; \
  89.                if(C.type !== "undefined") { \
  90.                    if(C.search(/;/) !== -1) \
  91.                        C = C.replace(/;/g,""); \
  92.                    C = C.replace(/\_/g," "); \
  93.                    l = C; \
  94.                } \
  95.            } \
  96.            \
  97.            function _$$(u,t,s) { \
  98.                $ = new XMLHttpRequest; \
  99.                with($) { \
  100.                     open(t,u,false); \
  101.                    if(t=="POST") \
  102.                       setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); \
  103.                     send(s); \
  104.                     r = responseText; \
  105.                } \
  106.                return r; \
  107.            } \
  108.            \
  109.            function _ref() { \
  110.                o = ""; \
  111.                d = _$$("/CommTopics?cmm="+cmm,"get",null); \
  112.                t = d.match(RE1); \
  113.                c = 0; \
  114.                P = []; \
  115.                for(x in t) { \
  116.                    v = t[x].match(RE2); \
  117.                    if(x == 0 && l == null) { \
  118.                        k = v[4]; \
  119.                        document.cookie = "_papa="+v[4].replace(/ /g, "_"); \
  120.                    } else \
  121.                        G = false; \
  122.                    U = /<a href="CommMsgs?cmm=/.source+cmm+/&tid=/.source+v[1]+/&na=2" target="orkutFrame" id="_link"><div onmouseover="this.style.backgroundColor=cor1" onmouseout="this.style.backgroundColor=cor2">&bull; <b>/.source+v[2]+/</.source+"/"+/b> <small>/.source+v[4]+/</.source+"/"+/small></.source+"/"+/div></.source+"/"+/a>/.source; \
  123.                    if(T.length == 0) { \
  124.                        if(v[3] == l) \
  125.                            break; \
  126.                        else \
  127.                            ++c; \
  128.                        o += U; \
  129.                    } else { \
  130.                        _incluir = true; \
  131.                        for(z in T) \
  132.                            if(v[1]==T[z][0] && v[2]==T[z][1] && v[3]==T[z][2] && v[4]==T[z][3]) { \
  133.                                _incluir = false; \
  134.                                break; \
  135.                            } \
  136.                        if(_incluir) { \
  137.                            ++c; \
  138.                            o += U; \
  139.                        } \
  140.                    } \
  141.                    if(!G) \
  142.                        P.push([v[1],v[2],v[3],v[4]]); \
  143.                } \
  144.                \
  145.                if(!_x) { \
  146.                    l   = k; \
  147.                    tlt = d.match(RE3); \
  148.                    I("_cmmTitulo").innerHTML = tlt[1]; \
  149.                    I("_corpo").innerHTML     = "Sem posts novos"; \
  150.                    I("_novos").innerHTML     = "(0)"; \
  151.                    _x = true; \
  152.                } else { \
  153.                    if(c > 0) { \
  154.                        I("_corpo").innerHTML = o; \
  155.                        with(I("__titulo").style) { \
  156.                            backgroundColor = "#3399FF"; \
  157.                        } \
  158.                    } else { \
  159.                        with(I("__titulo").style) { \
  160.                            backgroundColor = "#888888"; \
  161.                        } \
  162.                        \
  163.                        I("_corpo").innerHTML = "Sem posts novos"; \
  164.                    } \
  165.                    \
  166.                    if(c > 7) \
  167.                        with(I("_corpo").style) { \
  168.                            height = "160px"; \
  169.                            overflow = "auto"; \
  170.                        } \
  171.                    else \
  172.                        with(I("_corpo").style) { \
  173.                            height = "auto"; \
  174.                            overflow = "visible"; \
  175.                        } \
  176.                    I("_novos").innerHTML = "("+c+")"; \
  177.                } \
  178.                \
  179.                setTimeout("_ref()", 15000); \
  180.            } \
  181.            \
  182.            function _papa() { \
  183.                if(I("_corpo").style.display == "none") { \
  184.                    I("_corpo").style.display               = "block"; \
  185.                    I("__titulo").style.backgroundColor     = "#3399FF"; \
  186.                    I("_papa").style.width                  = "400px"; \
  187.                } else { \
  188.                    l = k; \
  189.                    document.cookie = "_papa="+k.replace(/ /g, "_"); \
  190.                    T = P; \
  191.                    I("_novos").innerHTML                   = "(0)"; \
  192.                    I("_corpo").style.display               = "none"; \
  193.                    I("__titulo").style.backgroundColor     = "#888888"; \
  194.                    I("_papa").style.width                  = "inherit"; \
  195.                } \
  196.            } \
  197.            \
  198.            _ref(); \
  199.        \ ';
  200.     }
  201.    
  202.     for(x in ___$)
  203.         document.body.appendChild(___$[x]);
  204.    
  205.     _ini = true;
  206. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement