コード例 #1
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int $id
  * @return Response
  */
 public function update($id)
 {
     if (is_numeric($id)) {
         $scraper = Scraper::findOrFail($id);
     } else {
         $scraper = Scraper::where('slug', $id)->firstOrFail();
     }
     $scraper->load('scrapes');
     return $scraper;
 }
コード例 #2
0
ファイル: NeasPortal.php プロジェクト: schlos/GreenAlert
 function __construct()
 {
     $this->scraper = Scraper::find(1);
     $this->scrape = new Scrape();
     $this->scrape->scraper()->associate($this->scraper);
     $this->scrape->file_directory = 'scrapes';
     $this->scrape->file_name = 'neas_portal';
     $this->client = new \Goutte\Client();
     $this->client->getClient()->setDefaultOption('config/curl/' . CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
     $this->client->getClient()->setDefaultOption('config/curl/' . CURLOPT_TIMEOUT, 0);
     $this->client->getClient()->setDefaultOption('config/curl/' . CURLOPT_TIMEOUT_MS, 0);
     $this->client->getClient()->setDefaultOption('config/curl/' . CURLOPT_CONNECTTIMEOUT, 0);
     $this->client->getClient()->setDefaultOption('config/curl/' . CURLOPT_RETURNTRANSFER, true);
     $this->neas_list_url = 'http://neas.environment.gov.za/portal/ApplicationsPerEAP_Report.aspx';
     $this->neas_eia_url = 'http://neas.environment.gov.za/portal/dNeasStandard_ApplicationHistory.aspx';
 }