GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   JavaScript to validate reciprocal links. (https://gfy.com/showthread.php?t=1047888)

Cyber Fucker 11-30-2011 09:38 AM

JavaScript to validate reciprocal links.
 
Does anyone have anything like that?
I need not server-side but client-side script to check reciprocal links / backlinks.
I have been searching for it for a while in Google but I couldn't find. There is plenty but curl or php.
I found some XMLHTTP but I'm still looking for something better.

:helpme

CyberHustler 11-30-2011 09:42 AM

I've been using this: http://www.webconfs.com/reciprocal-link-checker.php

Not the same, but works

fris 11-30-2011 09:44 AM

you need server side, not client. i dont think its possible to do with javascript alone.

SmokeyTheBear 11-30-2011 10:03 AM

impossible as far as i am aware

raymor 11-30-2011 10:10 AM

It's certainly possible. You can put a javascript: url into a bookmark and run it by clicking the button in your bookmarks bar. I use some Javascript which finds links and does some checking on rhe format if the links. You could then pass the url directly to xmlhttprequest or make it easier by using jquery. You've then pass the response back through your link parsing routine to check for the reciprocal link.

Cyber Fucker 11-30-2011 10:12 AM

Quote:

Originally Posted by raymor (Post 18595021)
It's certainly possible. You can put a javascript: url into a bookmark and run it by clicking the button in your bookmarks bar. I use some Javascript which finds links and does some checking on rhe format if the links. You could then pass the url directly to xmlhttprequest or make it easier by using jquery. You've then pass the response back through your link parsing routine to check for the reciprocal link.

Interesting approach... however, it cannot use browser bookmarks... I'm building a tool that will be on a website, and many users will be using it. I would like to offload my server though, if the queries may be done on client-side then there is no reason for me to rip my own server which can also lead to blocking its IPs within various places and abuse. If I will not find a proper client-side solution that could be combined into the website I will have to put it on some external VPS cause I cannot afford any problems with the main server. :helpme

SmokeyTheBear 11-30-2011 10:22 AM

btw .. why not just use php ?

Cyber Fucker 11-30-2011 10:40 AM

If it was only for myself then yes, php/curl is the way, but it's for hundreds of other folks, so, it makes a difference. If it could be done on client-side then why rip the server, in the end the final results would be the same, backlinks are either valid or not. :)

SmokeyTheBear 11-30-2011 10:44 AM

why dont you explain a bit more about what you are trying to do, there may be better ways to approach the same idea.

Cyber Fucker 11-30-2011 10:54 AM

Uh, oh I think there is not much more to explain than I already explained. :) I just need a function that will validate backlink status.

For example here is a php script sample to validate reciprocal link, I don't even know if it works or not but let's presume that it works:

Code:

$linkAction = $_POST['action'];
$recip_url= $_POST['recip_url'];

if($lnkAction == '1' && isset($recip_url))
        {
                $this_url = 'http://www.my_url.com';
               
                $recip_url = $recip_url;
               
                $source = fopen($recip_url, 'r');
               
                $contents = stream_get_contents($source);
               
                if(stristr($contents, $this_url)) {
                        echo '0';
                } else {
                        echo '1';
                }
               
                fclose($source);
        }


Now, I want to do the same thing but on a client-side preferably using JavaScript (JavaScript extensions like jQuery or Yui are also acceptable). :helpme

EukerVoorn 11-30-2011 10:57 AM

Use php for this. Use Java scripts for things it's intended for.

redwhiteandblue 11-30-2011 11:32 AM

You're far better off using PHP and making use of the DOMDocument class for this, I'm not aware of anything in Javascript that will let you do what you want (happy to be proven wrong though).

Serge Litehead 11-30-2011 11:47 AM

find js expert, js is so flexible and works beautifully with DOM, it should be able to load remote page and parse it element by element to see if there are link matches. resources wise can't tell what it could be like on client machines, one or two links could be fine, checking multiple backlinks might be noticeably hit on performance.

fris 11-30-2011 11:58 AM

or use javascript with php using ajax

xcode 11-30-2011 12:21 PM

its possible using an ajax call but i dont recommend it cause you will collapse the surfer memory

porndotnet 12-03-2011 08:50 PM

js doesn't have the ability to do it on it's own, you'll need php to make the cross domain request.

raymor 12-03-2011 10:27 PM

Quote:

Originally Posted by Cyber Fucker (Post 18595025)
Interesting approach... however, it cannot use browser bookmarks... I'm building a tool that will be on a website, and many users will be using it. I would like to offload my server though, if the queries may be done on client-side then there is no reason for me to rip my own server which can also lead to blocking its IPs within various places and abuse. If I will not find a proper client-side solution that could be combined into the website I will have to put it on some external VPS cause I cannot afford any problems with the main server. :helpme

The same script can be attached to a button on a page. Within a page, you do run into cross domain restrictions. You can deal with that by proxying through the origin server, or using yql:
http://james.padolsey.com/javascript/cross-domain-requests-with-jquery/

Javascript can also be divorced from cross domain restrictions by being packaged as a Firefox addon.

That's going to be the challenging part about JavaScript - working around cross domain restrictions in some way. Doing it server side would be easier certainly.

Being worried about your main server being blocked due to too many requests, a small VPS might be reasonable. If you expect a large volume of users, but want to minimize the hardware requirements, code written in C will handle roughly 150 times as much traffic on the same hardware compared to PHP. Perl is roughly three times as fast as PHP, and still so similar that a lot of code is both valid Perl and valid PHP. So if you were going to do it server side, just changing a few lines to make it Perl rather than PHP triples your throughout or so:

http://xodian.net/serendipity/index....-vs.-Ruby.html

V_RocKs 12-03-2011 11:00 PM

Quote:

Originally Posted by fris (Post 18595356)
or use javascript with php using ajax

ftw............

cam_girls 12-03-2011 11:03 PM

hidden frame?


All times are GMT -7. The time now is 03:02 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc