[pmwiki-users] pmwiki-users read ptv of another wiki

John Rankin john.rankin at affinity.co.nz
Thu Oct 16 15:55:58 CDT 2008

>Date: Wed, 15 Oct 2008 14:31:01 -0500
>From: "Patrick R. Michaud" <pmichaud at pobox.com>
>Subject: Re: [pmwiki-users] read ptv of another wiki
>To: noskule <noskule at gmx.net>
>On Wed, Oct 15, 2008 at 06:51:28PM +0200, noskule wrote:
>> Yes I did see, but I'm looking for a way to get ptv's from independent 
>> wikis. For example, I would like to check if a cookbook receipted has a 
>> different version number as the one I have installed, something like
>> (:if ! equal  "{$XY-version}" 
>> "http://pmwiki.org/cookbook/XY$:Version":)New version of XY
>How about http://www.pmwiki.org/wiki/Cookbook/RecipeCheck for
>In answer to the generic question of "read a PTV from another
>wiki", there's not a supported way to do it.  It would require the
>local PHP to be configured with url_fopen support (many are, many
>aren't) and it could badly increase the traffic load on the remote PmWiki
>system that is having its PTV's read via the net.
Option 1. Maybe this will work:

1. create a form where pressing a button causes a request to the remote
   wiki, but don't expect the remote wiki to tell you the PTV value

2. in the local action associated with pressing the button, do

    $t = file("$remoteWikiAddress?n=$pagename&action=source");

3. process the source held in $t to extract the required PTV

4. display the result of the PTV request using the same technique
   used to display search results

Option 2.
Alternatively, if the remote wiki is willing to do some work,
one ought to be able to customise the action=dc Dublin Core
feed to include PTV name and value pairs, which the requesting
wiki can then unravel. In this approach, step 2 above becomes

     $t = file("$remoteWikiAddress?n=$pagename&action=dc");

Option 3. (the easiest, if the host is willing)
If the requesting wiki is willing to do even more work, you
could create a regular external link of the form


Then you just click on the link to see the result. This would
be the easiest solution, but requires a willing remote host.
John Rankin

More information about the pmwiki-users mailing list