Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
buechereielektrik:unapi:bibsonomy.php [2009-12-26 14:45] – made downloadable rosenkebuechereielektrik:unapi:bibsonomy.php [2010-01-27 20:19] rosenke
Line 1: Line 1:
 <code php Bibsonomy.php> <code php Bibsonomy.php>
-<?php +<?php
  
-// hatop@ub.uni-marburg.de 2008-12-08 2009-12-03 +/
-// http://unapi.info/specs/+  Purpose 
 + * 
 +  Take an unique identifier as id-parameter and redirect client 
 +  to Bibsonomy with BibTeXed bibliographic data
 + */
  
-/*  Copyright 2008 2009 Goetz Hatop+/
 +  Copyright 
 + * 
 + *  Copyright 2008 2009 Goetz Hatop <hatop@ub.uni-marburg.de>.
   Goetz Hatop's original Version can be found at   Goetz Hatop's original Version can be found at
-  <ftp://ftp.ub.uni-marburg.de/pub/research/unapi.tar.gz> +  <ftp://ftp.ub.uni-marburg.de/pub/research/unapi.tar.gz>
 + * 
 +  Copyright 2009 2010 Stephan Rosenke <rosenke@ulb.tu-darmstadt.de> or 
 +  <r01-551@r0s.de>. See also <http://r0s.de/unapi>.
  */  */
  
-/*  Copyright 2009 Stephan Rosenke <rosenke@ulb.tu-darmstadt.de> */ +/* 
- +  License 
-/*  This program is free software: you can redistribute it and/or modify+ * 
 +  This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or   the Free Software Foundation, either version 3 of the License, or
Line 26: Line 37:
  */  */
  
-/*  Version: 0.*/+/
 + *  Version 
 + * 
 + *  0.
 + */
  
-/*  Changelog+/
 + *  Changelog
  *  *
 +  20100127: Added link in copyright.
 +  20100110: Some style improvements, added comments.
 +  20100109: Some style improvements, added comments.
   20091214: stripped unAPI.php for use as Bibsonomy-forwarder.   20091214: stripped unAPI.php for use as Bibsonomy-forwarder.
  */  */
  
-require_once('PicaRecord.php');+/* 
 +  Readme 
 + * 
 +  For linking to Bibsonomy include in a HTML-file a line like this: 
 +  <a href="http://example.com/Bibsonomy.php?id=123">Bibsonomy</a> 
 + */ 
 + 
 +/* 
 + * 
 +  DO NOT MESS BEHIND THIS LINE 
 + * 
 + */ 
 + 
 +//  include some objects and methods 
 +require_once('unAPI.inc.php')
 + 
 +//  make some GET-variables a little bit handier 
 +$id = $_GET['id'];
  
-if (!isset($_GET[id]) || $_GET[id]=='') {+//  check if $id is not empty 
 +if (!isset($id) || $id == '') {
   header('HTTP/1.0 406 Not Acceptable');   header('HTTP/1.0 406 Not Acceptable');
   echo "406: Not Acceptable";   echo "406: Not Acceptable";
-  return;     +  return; 
-+}
  
 +//  instantiate new Picappn()
 $pica = new Picappn(); $pica = new Picappn();
-$pica->setPpn( $_GET[id] ); 
  
 +//  set PPN as identifier
 +$pica->setPpn($id);
 +
 +//  get URL for redirecting to Bibsonomy
 $res = $pica->getBibsonomy(); $res = $pica->getBibsonomy();
-header("Location: $res");+ 
 +//  check if $res is not empty and do redirect 
 +if (!isset($res) || $res == '') { 
 +  header('HTTP/1.0 406 Not Acceptable'); 
 +  echo "406: Not Acceptable"; 
 +  return; 
 +} else { 
 +  header("Location: $res"); 
 +}
  
 ?> ?>
 </code> </code>
buechereielektrik/unapi/bibsonomy.php.txt · Last modified: 2011-01-20 17:12 by strols
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0