This is a discussion on Wikipedia XML -> PHP? within the PHP Language forums, part of the PHP Programming Forums category; How would I get this Wikipedia XML: http://en.wikipedia.org/wiki/Special...lastair_Ralphs into a PHP variable (without copy ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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. |
|
|||
|
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_contents(): http://us3.php.net/manual/en/functio...t-contents.php 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://en.wikipedia.org/wiki/Wikiped...abase_download http://download.wikimedia.org/ 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.com | 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 |
|
|||
|
"Benjamin Esham" <bdesham@gmail.com> wrote in message news:Ea2Mg.103$Ka1.58@news01.roc.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_contents(): > > http://us3.php.net/manual/en/functio...t-contents.php > > 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://en.wikipedia.org/wiki/Wikiped...abase_download > 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. |
|
|||
|
>>>>> "Cain" <Cain34345@243K4ooko342o.net> (C) wrote:
>C> How would I get this Wikipedia XML: >C> http://en.wikipedia.org/wiki/Special...lastair_Ralphs into a PHP >C> variable (without copy and pasting it manually)? You mean the contents of the document that the URL points to? $url = "http://en.wikipedia.org/wiki/Special:Export/Alastair_Ralphs"; $handle = fopen($url, "r"); $contents = stream_get_contents($handle); fclose($handle); or use file_get_contents. -- Piet van Oostrum <piet@cs.uu.nl> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: piet@vanoostrum.org |
|
|||
|
Piet van Oostrum wrote:
>>>>>> "Cain" <Cain34345@243K4ooko342o.net> (C) wrote: > >> C> How would I get this Wikipedia XML: >> C> http://en.wikipedia.org/wiki/Special...lastair_Ralphs into a PHP >> C> variable (without copy and pasting it manually)? > > You mean the contents of the document that the URL points to? > > $url = "http://en.wikipedia.org/wiki/Special:Export/Alastair_Ralphs"; > $handle = fopen($url, "r"); > $contents = stream_get_contents($handle); > fclose($handle); > > or use file_get_contents. 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: http://www.eclipse.org/downloads The plugin link is here: http://www.plog4u.org/index.php/Main_Page -- 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-) |
|
|||
|
Piet van Oostrum wrote:
>>>>>> "Cain" <Cain34345@243K4ooko342o.net> (C) wrote: > >> C> How would I get this Wikipedia XML: >> C> http://en.wikipedia.org/wiki/Special...lastair_Ralphs into a PHP >> C> variable (without copy and pasting it manually)? > > You mean the contents of the document that the URL points to? > > $url = "http://en.wikipedia.org/wiki/Special:Export/Alastair_Ralphs"; > $handle = fopen($url, "r"); > $contents = stream_get_contents($handle); > fclose($handle); > > or use file_get_contents. 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: http://www.eclipse.org/downloads The plugin link is here (Plog4U): http://www.plog4u.org/index.php/Main_Page -- 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-) |
|
|||
|
> 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 http://www.plog4u.org/index.php/Usin...ipedia_Article "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:HTML]] 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. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|