| @@ -28,26 +28,22 @@ function random_record (){ | |||
| // Search for the application ID in the content element and display it | |||
| $content = $json->response->docs[$random]->content; | |||
| preg_match('/Application.*\n(.*)\n/', $content, $application_id); | |||
| $application_id = json_encode($application_id[1]); | |||
| $output['application_id'] = $application_id; | |||
| $output['application_id'] = $application_id[1]; | |||
| // Search for the publication URL in the content element and display it | |||
| $content = $json->response->docs[$random]->content; | |||
| preg_match('/Publication.*\n(.*)\n/', $content, $publication); | |||
| $publication_url = json_encode($publication[1]); | |||
| $output['publication_url'] = $publication_url; | |||
| $output['publication_url'] = $publication[1]; | |||
| // Search for the title in the content element and display it | |||
| $content = $json->response->docs[$random]->content; | |||
| preg_match('/Title.*\n(.*)\n/', $content, $title); | |||
| $title = json_encode($title[1]); | |||
| $output['title'] = $title; | |||
| $output['title'] = $title[1]; | |||
| // Search for the abstract in the content element and display it | |||
| $content = $json->response->docs[$random]->content; | |||
| preg_match('/Abstract.*\n(.*)\n/', $content, $abstract); | |||
| $abstract = json_encode($abstract[1]); | |||
| $output['abstract'] = $abstract; | |||
| $output['abstract'] = $abstract[1]; | |||
| return $output; | |||