Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: Swordmaker
The original source code of the page which I copied was spaghetti code and essentially indecipherable to locate where they were on the block of gobble-de-gook code. Otherwise I would have attempted to resolve them. It was a mess of HTML. Sorry.

You posted JavaScript copied from irishtimes.com to FR without fixing the links. E.g., consider this excerpt:

Instead of cash, people pay Google in kind: with their identity, their behaviour, their habits and their preferences. Google collates and analyses this user data on a global scale, sells it to advertisers and, according to <a class="search" href="/search/search-7.1213540?tag_person=Edward Snowden&article=true">Edward Snowden</a>, more than occasionally gifts it to US and other intelligence services.

The link in the above is relative, not absolute. It doesn't name an actual server, letting the browser assume it's to be served from the same source as the article. If you repost that on FR, the user's browser will expect the link to be relative to FR, i.e., http://freerepublic.com/search/search-7.1213540?tag_person=Edward Snowden&article=true. That will 404, since FR's server does not recognize that request.

Before posting copied HTML on FR, you need to convert any relative links it may contain to absolute links. E.g.,

Instead of cash, people pay Google in kind: with their identity, their behaviour, their habits and their preferences. Google collates and analyses this user data on a global scale, sells it to advertisers and, according to <a class="search" href="http://www.irishtimes.com/search/search-7.1213540?tag_person=Edward%20Snowden&article=true">Edward Snowden</a>, more than occasionally gifts it to US and other intelligence services.

This will cause the copied HTML to refer back to its original server, greatly improving the chance that it will produce something interesting. Here is the end result for the above:

Instead of cash, people pay Google in kind: with their identity, their behaviour, their habits and their preferences. Google collates and analyses this user data on a global scale, sells it to advertisers and, according to Edward Snowden, more than occasionally gifts it to US and other intelligence services.

Of course, this particular link is quite useless, being merely a list of Irish Times articles that mention Edward Snowden. But the point is, now it works!

The way to proceed when posting foreign HTML is to convert any relative URLs to absolute URLs before scarfing the HTML code. Given a simple bookmarklet, this is a trivial task. All the bookmarklet does is to rifle through the page's links (including images) and assign each link to itself. This has the effect of converting relative links to absolute. Then you simply grab and post the converted HTML. Mousing over the links in the preview will confirm whether you got it right.

14 posted on 05/15/2015 1:02:26 AM PDT by cynwoody
[ Post Reply | Private Reply | To 10 | View Replies ]


To: cynwoody

I know. . . But the source was a block of a mess. I’ve fixed those relative links before. The page code when it came up was a mess and I just did not feel like going through it. I’m going to have to have cataract surgery next month (whine) GRIN! and seeing those in a block of red print (why red?) irritated me. I just was tired. . . I usually do take the time to clean it up, but this one was unusually bad. I pulled some extraneous junk out of it and posted as is.


15 posted on 05/15/2015 1:12:18 AM PDT by Swordmaker ( This tag line is a Microsoft insult free zone... but if the insults to Mac users contnue...)
[ Post Reply | Private Reply | To 14 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson