-
Notifications
You must be signed in to change notification settings - Fork 10
Home
dulcedo edited this page Sep 14, 2010
·
3 revisions
YaCyOAI is a small piece of PHP for quering a YaCy peer indexing OAI (Open Archive) Information.
YaCy is providing a rich HTML/XML based API and plugin-classes for most languages. Take YaCyOAI as a sample to simplify a query using this API and or generate a customized display of found results . Feel free to commit additional or enhance the existing modules / functions.
You need PHP5 for using this example, Windows users may use XAMPP or easy-PHP, most other OS have buildt-in PHP-support.
Of course you will also need access to one or more YaCy-peers, either by obtainig the address and accounting, or using your own YaCy-peer.
Place all included files in a subdir of your local- oder servers htroot and start your favorite browser calling index.php.
YaCyOAI is using a file peerlist_inc.php to store adresses and accounting for all YaCy-peers queried by the application.
//-———— edit here-———- // array of possipble peers 0:ip, 1:port, 2:user:pw, 3: opt.friendlyname // do NOT use localhost but (public) IP/hostname // first peer #0 used to access network-information, must be present and online. $i= 0; $this_YaCyPeer[$i][ 0]=“127.0.0.1”; $this_YaCyPeer[$i][ 1]=“8080”; this_YaCyPeer[$i][ 2]=“admin:password”;$this_YaCyPeer[$i]3=“my_friendlyname_for_this_peer”; $i= 1; $this_YaCyPeer[$i][ 0]=“other.ip”; $this_YaCyPeer[$i][ 1]=“8081”; $this_YaCyPeer[$i][ 2]=“nopassword”; // … and so on
The first primary peer is used to search the given query and mandatory. Other peers listed are offered as fallback in cases the primary peer doesn’t answer.
If another similar file peerlist_alt.php is found it is used instead and information stored in peerlist_inc.php will be ignored..