Wikipedia XML -> PHP?

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

    #1

    Wikipedia XML -> PHP?

    How would I get this Wikipedia XML:
    http://en.wikipedia.org/wiki/Special...lastair_Ralphs into a PHP
    variable (without copy and pasting it manually)?

    Thanks,

    Cain.


  • Benjamin Esham

    #2
    Re: Wikipedia XML -> PHP?

    Cain wrote:
    How would I get this Wikipedia XML:
    http://en.wikipedia.org/wiki/Special...lastair_Ralphs into a PHP
    variable (without copy and pasting it manually)?
    Use file_get_conten ts():



    By the way... if you're going to be doing a lot of work with Wikipedia's
    data, please download your own copy of the database:




    Not only will your scripts run faster, but it will also take some strain off
    of Wikipedia's servers.

    HTH,
    --
    Benjamin D. Esham
    bdesham@gmail.c om | AIM: bdesham128 | Jabber: same as e-mail
    "In the beginning the Universe was created. This has made a lot
    of people very angry and been widely regarded as a bad move."
    — Douglas Adams

    Comment

    • Cain

      #3
      Re: Wikipedia XML -> PHP?


      "Benjamin Esham" <bdesham@gmail. comwrote in message
      news:Ea2Mg.103$ Ka1.58@news01.r oc.ny...
      Cain wrote:
      >
      >How would I get this Wikipedia XML:
      >http://en.wikipedia.org/wiki/Special...lastair_Ralphs into a PHP
      >variable (without copy and pasting it manually)?
      >
      Use file_get_conten ts():
      >

      >
      By the way... if you're going to be doing a lot of work with Wikipedia's
      data, please download your own copy of the database:
      >

      http://download.wikimedia.org/
      I don't want to download the entire database, I only want some of the
      articles. Can someone please tell me how I can get these articles into a
      MySQL database?

      Thanks,

      Cain.


      Comment

      • Piet van Oostrum

        #4
        Re: Wikipedia XML -&gt; PHP?

        >>>>"Cain" <Cain34345@243K 4ooko342o.net(C ) wrote:
        >CHow would I get this Wikipedia XML:
        >Chttp://en.wikipedia.org/wiki/Special...lastair_Ralphs into a PHP
        >Cvariable (without copy and pasting it manually)?
        You mean the contents of the document that the URL points to?

        $url = "http://en.wikipedia.or g/wiki/Special:Export/Alastair_Ralphs ";
        $handle = fopen($url, "r");
        $contents = stream_get_cont ents($handle);
        fclose($handle) ;

        or use file_get_conten ts.
        --
        Piet van Oostrum <piet@cs.uu.n l>
        URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C 4]
        Private email: piet@vanoostrum .org

        Comment

        • IchBin

          #5
          Re: Wikipedia XML -&gt; PHP?

          Piet van Oostrum wrote:
          >>>>>"Cain" <Cain34345@243K 4ooko342o.net(C ) wrote:
          >
          >CHow would I get this Wikipedia XML:
          >Chttp://en.wikipedia.org/wiki/Special...lastair_Ralphs into a PHP
          >Cvariable (without copy and pasting it manually)?
          >
          You mean the contents of the document that the URL points to?
          >
          $url = "http://en.wikipedia.or g/wiki/Special:Export/Alastair_Ralphs ";
          $handle = fopen($url, "r");
          $contents = stream_get_cont ents($handle);
          fclose($handle) ;
          >
          or use file_get_conten ts.
          This is not a solution that you maybe looking for but here goes. The
          Eclipse IDE has a wikipedia Plugin that will pert much let you download
          change and upload.. There is much more to to this plugin. I figured I
          would let you be aware of it.

          Naturally the Eclipse link is:
          The Eclipse Foundation - home to a global community, the Eclipse IDE, Jakarta EE and over 415 open source projects, including runtimes, tools and frameworks.


          The plugin link is here:
          Find information, resources and relevant links for plog4u.org. This domain may be for sale.


          --
          Thanks in Advance...
          IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
          'If there is one, Knowledge is the "Fountain of Youth"'
          -William E. Taylor, Regular Guy (1952-)

          Comment

          • IchBin

            #6
            Re: Wikipedia XML -&gt; PHP?

            Piet van Oostrum wrote:
            >>>>>"Cain" <Cain34345@243K 4ooko342o.net(C ) wrote:
            >
            >CHow would I get this Wikipedia XML:
            >Chttp://en.wikipedia.org/wiki/Special...lastair_Ralphs into a PHP
            >Cvariable (without copy and pasting it manually)?
            >
            You mean the contents of the document that the URL points to?
            >
            $url = "http://en.wikipedia.or g/wiki/Special:Export/Alastair_Ralphs ";
            $handle = fopen($url, "r");
            $contents = stream_get_cont ents($handle);
            fclose($handle) ;
            >
            or use file_get_conten ts.
            This is not a solution that you maybe looking for but here goes. The
            Eclipse IDE has a wikipedia Plugin that will pert much let you download
            change and upload.. There is much more to to this plugin. I figured I
            would let you be aware of it.

            Naturally the Eclipse link is:
            The Eclipse Foundation - home to a global community, the Eclipse IDE, Jakarta EE and over 415 open source projects, including runtimes, tools and frameworks.


            The plugin link is here (Plog4U):
            Find information, resources and relevant links for plog4u.org. This domain may be for sale.


            --
            Thanks in Advance...
            IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
            'If there is one, Knowledge is the "Fountain of Youth"'
            -William E. Taylor, Regular Guy (1952-)

            Comment

            • Cain

              #7
              Re: Wikipedia XML -&gt; PHP?

              The
              Eclipse IDE has a wikipedia Plugin that will pert much let you download
              change and upload..
              Thanks for this although I've not got it working yet.

              I'm following these steps from
              Find information, resources and relevant links for plog4u.org. This domain may be for sale.


              "Example: grabbing a wikibooks.org article
              a.. create a new index.wp file under your projects /wpsrc directory
              b.. write a Wiki link definition somewhere in the editor, for example:
              [[Programming:HTM L]]
              c.. do a "right mouse" click on the link and select menu Open Wiki Link
              d.. a new file with the corresponding *.wp filename should open.
              e.. do a "right mouse" click on the file name in the Navigator View' and
              select menu Wikipedia Download->Refresh Wikipedia from Web
              f.. in the opening dialog box select WikibooksEN Download"

              However I when I do the last step I don't get any URLs in the opening dialog
              box.

              Can you help?

              Thanks,

              Cain.


              Comment

              Working...