Activity Stream
48,167 MEMBERS
6841 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 7 of 7
  1.     
    #1
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com

    Default help with Google PR, In JS

    heya guys.

    im working on a PR Checker plugin for jQuery but i cant seem to get the hashing to work.

    The hashing it returns is invalid and im unsure why exactly.

    Take a look at the code

    Code: 
    (
    	$.fn.PageRank = function(callback)
    	{
    		var _library = new Object();
    		
    		//Creat the system library
    		var HASH_SEED = "Mining PageRank is AGAINST GOOGLE'S TERMS OF SERVICE. Yes, I'm talking to you, scammer."
    		_library.parseUrl = function(a)
    		{
    			var b = {};
    			/*
    				* parse the url to extract its parts
    			*/
    			if (a = a.match(/((s?ftp|https?):\/\/){1}([^\/:]+)?(:([0-9]+))?([^\?#]+)?(\?([^#]+))?(#(.+))?/)) {
    				b.scheme = a[2] ? a[2] : "http";
    				b.host = a[3] ? a[3] : null;
    				b.port = a[5] ? a[5] : null;
    				b.path = a[6] ? a[6] : null;
    				b.args = a[8] ? a[8] : null;
    				b.anchor = a[10] ? a[10] : null
    			}
    			return b
    		}
    
    		_library.toHex = function(a){
    			return (a < 16 ? "0" : "") + a.toString(16)
    		}
    
    		_library.hexEncodeU32 = function(a) {
    			var b = _library.toHex(a >>> 24);
    			b += _library.toHex(a >>> 16 & 255);
    			b += _library.toHex(a >>> 8 & 255);
    			return b + _library.toHex(a & 255)
    		}
    		
    		_library.generateHash = function(a)
    		{
    			for (var b = 16909125, c = 0; c < a.length; c++)
    			{
    				b ^= HASH_SEED.charCodeAt(c % 87) ^ a.charCodeAt(c);
    				b = b >>> 23 | b << 9;
    			}
    			return _library.hexEncodeU32(b)
    		}
    
    		var CheckPageRank = function(url)
    		{
    			urlSegments = _library.parseUrl(url);
    			if(urlSegments && urlSegments.host)
    			{
    				checkLocation = "http://www.google.com/search?client=navclient-auto&ch=8" + _library.generateHash(urlSegments.host) + "&features=Rank&q=info:" + urlSegments.host;
    				return checkLocation
    			}
    			return false;
    		}		
    		//Return the callback
    		$(this).each(function(){
    			page_rank = CheckPageRank(this.href);
    			callback(page_rank);
    		})
    	}
    )(jQuery);
    Usage in jQuery is like so:

    Code: 
    $(document).ready(function() {
    	$('a').PageRank(function(pr){
                 $(this).append('Pr: ' pr);
    	})
    })
    but if you alert the pr its the url obv because i havent built in te ajax yet but can anyone understand why this is not working ?

    Heres the code i have studied

    http://www.v7n.com/forums/coding-for...cript-php.html
    litewarez Reviewed by litewarez on . help with Google PR, In JS heya guys. im working on a PR Checker plugin for jQuery but i cant seem to get the hashing to work. The hashing it returns is invalid and im unsure why exactly. Take a look at the code ( Rating: 5
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  2.   Sponsored Links

  3.     
    #2
    Member
    Have you tried asking for help over at stackoverflow.com
    Im still learning jquery so i cant help unfortunately but i have asked some questions about jquery and other stuff over their and they are really helpful just an option if no one can help you here
    Signature too big, removed by staff.

  4.     
    #3
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    Ca't really post his on my Stack Account lol, it is illegal :/ Im waiting for Hypers,Jayfella to see if they have experience here

    Thanks anyway.
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  5.     
    #4
    Respected Developer
    Website's:
    PlatinumW.org NexusDDL.com HD-United.org CheckLinks.org FLVD.org
    Are you sure if the algorithm is valid?

  6.     
    #5
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    yea i fixed it now, it was because of the href being detected by jQuery has to be the exact domain and path not litewarez.net/

    I knew the algorithm was ok because its not really that complex, just the 1 string into a checksum.
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  7.     
    #6
    Respected Developer
    Website's:
    PlatinumW.org NexusDDL.com HD-United.org CheckLinks.org FLVD.org
    ^ lol, that makes me remember one time I was pulling my hair because my AJAX requests wouldn't work (I had just changed to https) and then I realised it was related to cross domain issues

  8.     
    #7
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    Lol yea... Cross domain scripting is a bitch. you have to be able to interoperate #items in urls or callbacks etc :/ its long
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 16
    Last Post: 9th Jul 2012, 07:22 AM
  2. Google Chrome browser taking your search to bing instead of Google?
    By happyvalentine in forum Tutorials and Guides
    Replies: 3
    Last Post: 19th Jun 2012, 05:56 PM
  3. Replies: 1
    Last Post: 14th Jun 2012, 07:59 AM
  4. Replies: 3
    Last Post: 2nd Dec 2011, 03:27 PM
  5. Replies: 0
    Last Post: 30th Jun 2010, 06:51 PM

Tags for this Thread

BE SOCIAL