Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--
- App get facebook ids and name from shares
- @author ngxson Nui Nui
- !! Must be run on chrome with arg --disable-web-security
- -->
- <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- </head>
- <body style="background: black; color: white; font-family: Consolas">
- <!--input id="clickMe" type="button" value="login" onclick="window.location.href='http://facebook.com';" />
- <input id="clickMe" type="button" value="clickme" onclick="nextPage();" /><font id="count"></font></br-->
- <font id="res">Ket qua share: <br/>---<br/></font>
- <script src='jquery.min.js'></script>
- <script>
- var mystr = "";
- var page=2;
- var num = 0;
- var num_old = 0;
- var res = document.getElementById("res");
- var count = document.getElementById("count");
- var mucclasses = ["12su"
- ,"12hoa2"
- ,"12dia"
- ,"12sinh"
- ,"12van"
- ,"12tin"
- ,"12phap"
- ,"12ly1"
- ,"12hoa1"
- ,"12toan2"
- ,"12ly2"
- ,"12anh2"
- ,"12nga"
- ,"12anh1"
- ,"12toan1"];
- window.onerror = function() {}
- function calcClass(i) {
- if (i==mucclasses.length) return;
- //function nextPage() {
- page++;
- $.ajax({
- url: 'muc_'+mucclasses[i]+'.txt',
- type: 'get',
- error: function(XMLHttpRequest, textStatus, errorThrown){
- //alert('status:' + XMLHttpRequest.status + ', status text: ' + XMLHttpRequest.statusText);
- nextPage();
- },
- success: function(data){
- mystr = data;
- processMe(i);
- }
- });
- //}
- }
- var errcount = 0;
- var temp_db = {};
- var TOTAL = 0;
- function processMe(i) {
- var uarray = mystr.split('\n');
- uarray.forEach(function(e){
- if (e == '') return;
- if (e.indexOf('30 avril') !== -1) return;
- var day = (e.match(/[0-9][0-9] avril/g)[0]).substring(0,2);
- var usr = e.match(/\\\"\\\/[^\\]*/gi);
- if (usr == null) return;
- addNoDuplicate(day, usr[0]);
- //document.write(e.substring(1,6)+'<br/>');
- });
- //document.write(JSON.stringify(temp_db));
- res.innerHTML += mucclasses[i] + ' : ' +TOTAL + '</br>';
- TOTAL = 0;
- temp_db = {};
- calcClass(i+1);
- }
- function addNoDuplicate(day, pid) {
- if (temp_db[day] == null || temp_db[day] == undefined) temp_db[day] = [];
- for (var j=0 ; j<temp_db[day].length ; j++) {
- if (pid == temp_db[day][j]) return;
- }
- temp_db[day].push(pid); TOTAL++;
- }
- function getParameterByName(name) {
- url = window.location.href;
- name = name.replace(/[\[\]]/g, "\\$&");
- var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
- results = regex.exec(url);
- if (!results) return null;
- if (!results[2]) return '';
- return decodeURIComponent(results[2].replace(/\+/g, " "));
- }
- calcClass(0);
- </script>
- </body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement