javacript:open

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • a_nona_mouse

    javacript:open

    got a website which I would like to be available offline


    any of the java script links

    is this possible? or is it server side so not possible. Even if it is
    there must be some way as you can do it manually so.. ?



    I just need all the estate agents websites in Aberdeen& surrounding
    counties & don't want to have to click on them all to find out what
    the web addess is

    any ideas

    ALex
  • Michael Winter

    #2
    Re: javacript:open

    On 23 Apr 2004 03:41:02 -0700, a_nona_mouse <a_nona_mouse@h otmail.com>
    wrote:
    [color=blue]
    > got a website which I would like to be available offline
    >
    > http://www.ukpropertyshop.co.uk/s/Ab...Aberdeen.shtml
    > any of the java script links
    >
    > is this possible? or is it server side so not possible. Even if it is
    > there must be some way as you can do it manually so.. ?[/color]

    You won't be able to get direct URLs to the various sites, as they are
    stored in the site's database.

    You can produce links to the site's CGI script, but if you were to place
    them on an another website, you'd end up leeching off of the UK Property
    Shop server's bandwidth.

    Mike

    --
    Michael Winter
    M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)

    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: javacript:open

      a_nona_mouse wrote:
      [color=blue]
      > got a website which I would like to be available offline
      > http://www.ukpropertyshop.co.uk/s/Ab...Aberdeen.shtml
      > any of the java script links
      >
      > is this possible?[/color]

      It is not if one uses those nonsense links, since a spider
      cannot follow them. <http://jibbering.com/faq/#FAQ4_24>
      [color=blue]
      > or is it server side so not possible.[/color]

      No, this is client-side scripting triggering a server-side application
      via HTTP GET. Would it be only server-side, there were no problem.
      [color=blue]
      > Even if it is there must be some way as you can do it manually so.. ?[/color]

      ?
      [color=blue]
      > I just need all the estate agents websites in Aberdeen& surrounding
      > counties & don't want to have to click on them all to find out what
      > the web addess is[/color]

      RTSL (Read The Source, Luke ;-)). The "JavaScript links" call a method
      named "openAgentSite" . That method is defined within the third "script"
      element of the document. Stripping information irrelevant here, only

      | function openAgentSite(a _uid){
      | [...]
      | "/cgi-bin/agentframe.pl?s ite=UKP&amp;s=e state&amp;irp=" +a_uid,

      is left (where the &amp; are nonsense, though [script data is CDATA
      in HTML, not PCDATA], and should not work). So if your UA supports
      DOM scripting (DHTML), you may loop over the collection of links to
      get the URIs:

      var s = "";
      for (var i = 0, len = document.links. length, s2; i < len; i++)
      {
      s2 = document.links[i].toString();
      if (/^javascript:ope nAgentSite/.test(s2))
      {
      s += s2.replace(
      /javascript:open AgentSite\('([^']+)'\);/,
      "/cgi-bin/agentframe.pl?s ite=UKP&s=estat e&irp=$1")
      + "\n";
      }
      }
      alert(s);

      The same as spaghetti code to be used in the Location Bar:

      javascript:s="" ;len=document.l inks.length;for (i=0;i<len;i++) {s2=document.li nks[i].toString();if(/^javascript:ope nAgentSite/.test(s2)){s+=s 2.replace(/javascript:open AgentSite\('([^']+)'\);/,"/cgi-bin/agentframe.pl?s ite=UKP&s=estat e&irp=$1")+"\n" ;}}alert(s);


      Use document.write( ) or DOM Level 1+ methods instead of
      alert() to append the URIs to a (new temporary) document.


      HTH

      PointedEars

      Comment

      • Dr John Stockton

        #4
        Re: javacript:open

        JRS: In article <4095B5AE.40204 09@PointedEars. de>, seen in
        news:comp.lang. javascript, Thomas 'PointedEars' Lahn
        <PointedEars@we b.de> posted at Mon, 3 May 2004 04:59:58 :[color=blue]
        >a_nona_mouse wrote:
        >[color=green]
        >> got a website which I would like to be available offline
        >> http://www.ukpropertyshop.co.uk/s/Ab...Aberdeen.shtml
        >> any of the java script links
        >>
        >> is this possible?[/color]
        >
        >It is not if one uses those nonsense links, since a spider
        >cannot follow them. <http://jibbering.com/faq/#FAQ4_24>[/color]

        You are being naive.

        For a spider to find a page, it is necessary only that a chain of
        spiderable links to that page exists.

        That, of itself, is no argument against using some other form of link
        where it is thought to be helpful to non-spiders.

        There may be a good case for what you want to say; but spurious
        arguments to not help.

        --
        © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
        <URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang. javascript
        <URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
        <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

        Comment

        Working...