Skip to main content
About Us
Funding Sources
Personnel
Projects
Services
Publications
Old Site
You are here
Home
»
Publications
» Publications
Node export of Publications
Primary tabs
View
Node export
(active tab)
Node export code
[{"vid":"290","uid":"1","title":"Publications","log":"","status":"1","comment":"0","promote":"0","sticky":"0","vuuid":"22dfa8a5-c5f6-4ca5-9c5c-99c104f65d31","nid":"117","type":"eprints_pass_thru","language":"und","created":"1412716424","changed":"1414020446","tnid":"0","translate":"0","uuid":"da313501-314e-41d6-a9da-7599c6ba0c9b","revision_timestamp":"1414020446","revision_uid":"1","body":{"und":[{"value":"\u003C?php\r\n\r\n\/**\r\n * WARNINGS:\r\n *\r\n * 1.) preg_replace() will quietly fail and return null if backtrack_limit is set\r\n * too low.\r\n *\r\n * For more information on this issue, see:\r\n * - http:\/\/us3.php.net\/manual\/en\/function.preg-replace.php\r\n * - http:\/\/www.pelagodesign.com\/blog\/2008\/01\/25\/wtf-preg_replace-returns-null\/\r\n *\r\n * 2.) preg_replace will produce different results for \u0027\/(.*)\/s\u0027 and \u0027\/^(.*)$\/s\u0027.\r\n * The first will result in 2 matches (and replacements), whereas the second\r\n * expression will produce 1 match. \r\n *\/\r\n\r\n\/\/ Make sure limit is set high enough, or preg_replace will fail.\r\nini_set(\u0027pcre.backtrack_limit\u0027, 10000000); # 10 MB\r\n\r\n\/\/ Extract needed information from incoming request.\r\n$url = parse_url($_SERVER[\u0027REQUEST_URI\u0027]);\r\n\r\n\/\/ Configure the outgoing request headers.\r\n$opts = array(\r\n \u0027http\u0027=\u003Earray(\r\n \u0027method\u0027=\u003E\u0022GET\u0022,\r\n \u0027header\u0027=\u003E\u0022Accept-language: en\\r\\n\u0022\r\n ) \r\n);\r\n$context = stream_context_create($opts);\r\n\r\n\/\/ Open the file using the HTTP headers set above.\r\n$modified_url = \u0027http:\/\/sigpubs.biostr.washington.edu\u0027 .\r\n preg_replace(\u0027\/^\\\/publications\/\u0027, \u0027\u0027, $url[\u0027path\u0027]) .\r\n (isset($url[\u0027query\u0027]) ? \u0027?\u0027 . $url[\u0027query\u0027] : \u0027\u0027);\r\n$file = file_get_contents($modified_url, false, $context);\r\n\r\n\/\/ Re-write browse items.\r\n$file = preg_replace(\r\n \u0027\/href=\u0022(year|author|projects|type|subjects|conference)\\\/\/\u0027,\r\n \u0027href=\u0022view\/\\\\1\/\u0027,\r\n $file);\r\n\r\n\/\/ Remove extraneous content and re-write the page. \r\n$patterns[0] = \u0027\/^.*(\u003Cdiv class=\u0022sigproject\u0022\u003E)(.*)(\u003C\\\/div\u003E).*$\/s\u0027;\r\n$patterns[1] = \u0027\/^(.*)(\u003Cdiv class=\u0022header\u0022\u003E.*\u003C\\\/div\u003E.*\u003C\\\/div\u003E.*\u003C\\\/div\u003E)(.*)$\/Us\u0027;\r\n$patterns[2] = \u0027\/href=\u0022\\\/\/\u0027;\r\n$patterns[3] = \u0027\/href=\u0022http:\\\/\\\/sigpubs\\.biostr\\.washington\\.edu(?!\\\/archive\\\/[0-9]+\\\/[0-9]+|\\\/perl\\\/users)\/\u0027;\r\n$patterns[4] = \u0027\/action=\u0022\\\/\/\u0027;\r\n$replacements[0] = \u0027\\\\1\\\\2\\\\3\u0027;\r\n$replacements[1] = \u0027\\\\1\\\\3\u0027;\r\n$replacements[2] = \u0027href=\u0022\/publications\/\u0027;\r\n$replacements[3] = \u0027href=\u0022\/publications\u0027;\r\n$replacements[4] = \u0027action=\u0022\/publications\/\u0027;\r\n$file = preg_replace($patterns, $replacements, $file);\r\n\r\n\/\/ Output the modified page.\r\nprint $file;\r\n\r\n?\u003E\r\n","summary":"","format":"php_code"}]},"cid":0,"last_comment_timestamp":"1412716424","last_comment_name":"","last_comment_uid":"1","comment_count":0,"name":"drupal","picture":"0","data":"b:0;","path":{"pid":"147","source":"node\/117","alias":"publications","language":"und"},"menu":null,"node_export_drupal_version":"7","#node_export_object":"1"}]
Copy this code and then on the site you want to import to, go to the
Node export: import
link under
Add content
, and paste it in there.