Archive for the ‘Uncategorized’ Category

Use facebook by JavaScript

Friday, November 25th, 2011

If you already get decision that computer programmes are better than humans for using facebook, you can continue reading…

 

There is many programming languages and scripting languages to write facebook user. I think, JavaScript is one of the best, because you can do anything in DOM. You can click objects, execute some functions and etc…

The most important thing is making requests on another pages and getting responses. In this case, you can use AJAX. But according to ECMAScript standards, you can’t make Ajax request from another domain. So your code must be on facebook.com. You can simply type next code in your browser address bar to load your script tag:

javascript:var s=document.createElement('script');s.src='http://domain.com/code.js';
document.body.appendChild(s);void(0)

 

After this, you can run your code on facebook and making requests by Ajax. There is two ways to manage your user. You can simply remove all DOM elements from currently loaded window and add your own functions. The best way to make currently loaded page your own, is function:

document.write()

Because it opens input stream  and removes all existing DOM elements: scripts, css styles, body, head and html. After this, you need to build your own DOM and you need body and head, so it’s better to use next code:

document.write('<html><head><title>Face controller</title></head><body></body></html>');

It creates new DOM for you. I’m using JQuery for build another elements.

You need to build functions as visual elements. In my code, the most useful function is  AJAX. It looks like this:

AJAX = function(args) {
		var that = this; // Save reference
		this.logger('Ajax activated...'); // Its my own logger function

		var currentCounter = 1; // Local variable to save and display asyncronous request state

		if(typeof args.vars == 'object') { // Convert URL variable object to string
			var varsObj = args.vars;
			args.vars = '';

			for(p in varsObj) {
				args.vars += p + '=' + varsObj[p] + '&'
			}
		}

		var MB = {};
		MB.vars = args.vars;
		MB.request = new XMLHttpRequest()
				|| new ActiveXObject("Msxml2.XMLHTTP")
				|| new ActiveXObject("Microsoft.XMLHTTP");

		MB.URL = args.url;
		MB.method = args.method || 'POST';
		MB.async = true;

		MB.request.open(MB.method, MB.URL, MB.async);
		MB.request.send(MB.vars);

		MB.request.onreadystatechange = function() { // Define callback
			currentCounter++; // For display difference between states

			that.logger('Still working : ' + MB.request.status + ', '
				+ MB.request.readyState + ', ' + currentCounter); // Display state
			if(MB.request.status === 200
				&& MB.request.readyState === 4) { // If response available
				args.callback(MB.request.responseText);
				// Run callback function and pass response text by argument
			}
		}
	};

You can use this function in all case to load another page located on facebook.com.

There is also many other functions and we can discuss about them later in detail.

 

The second way to create facebook user manager is to add your own buttons and other manager tools real facebook page directly.

For example, you can add button by name “Add 1000 like” under the all photo, or page. It’s more comfortable and also more difficult. But in this way, you can simply switch on manage mode on facebook by typing single code in address bar and do both: using and managing facebook. Also your manager will be very easy to use and you can give it your friends and other non-programmer people. I’ve never made manager by this type, but I hope, that we can do it together ))…

By George

Thursday, November 24th, 2011

ლინკს არავინ არ კრეფს, ლინკს აჭერენ

Using facebook

Thursday, November 24th, 2011

Today there are many important functions and events on facebook.

You can start and improve your business here, you can locate your company ads on facebook.

You can create new applications for facebook and etc…

 

But it’s very difficult to do it by yourself, without computer programmes.

Why computer programmes are better then humans?

Because they don’t need sleep, salary,  food, break and the most important thing is that they don’t think and  waste time for their girlfriends and boyfriends, because they can’t feel anything.

They always do what you want, and if they  make mistakes, it’s because you don’t know their language, not because they don’t like you.

So, if you know how to speak with them, they always do anything exactly what you want.

 

The most important thing is to see real difference between humans and computer programmes.