當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Page::analyse方法代碼示例

本文整理匯總了PHP中Page::analyse方法的典型用法代碼示例。如果您正苦於以下問題:PHP Page::analyse方法的具體用法?PHP Page::analyse怎麽用?PHP Page::analyse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Page的用法示例。


在下文中一共展示了Page::analyse方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: analyse

 function analyse()
 {
     parent::analyse();
     if (substr($this->url, 0, 30) == "http://www.worldcat.org/title/" && preg_match("@/oclc/([0-9]*)@", $this->url, $matches)) {
         $this->switchTo = ['document' => ['class' => 'Book', 'params' => ['OCLC' => $matches[1]], 'method' => 'queryWorldCatFromOCLC'], 'template' => 'book'];
     }
 }
開發者ID:dereckson,項目名稱:source-templates-generator,代碼行數:7,代碼來源:worldcat.php

示例2: analyse

 /**
  * Analyses the page and extracts metadata
  */
 function analyse()
 {
     parent::analyse();
     $this->skipAuthor = true;
     $this->extractYYYYMMDDDateFromURL();
     $this->site = "[[Anime News Network]]";
 }
開發者ID:dereckson,項目名稱:source-templates-generator,代碼行數:10,代碼來源:animenewsnetwork.php

示例3: analyse

 /**
  * Analyses the page and extracts metadata
  */
 function analyse()
 {
     parent::analyse();
     // Hardcoded known info
     $this->site = "Footoféminin";
     $this->parseDate();
 }
開發者ID:dereckson,項目名稱:source-templates-generator,代碼行數:10,代碼來源:footofeminin.php

示例4: analyse

 /**
  * Analyses the page and extracts metadata
  */
 function analyse()
 {
     parent::analyse();
     $this->author = self::between('rel="author">', '</a>');
     $this->extractYYYYMMDDDateFromURL();
     $this->site = "[[AnimeLand]]";
 }
開發者ID:dereckson,項目名稱:source-templates-generator,代碼行數:10,代碼來源:animeland.php

示例5: analyse

 /**
  * Analyses the page and extracts metadata
  */
 function analyse()
 {
     parent::analyse();
     $this->site = '[[Los Angeles Times]]';
     $this->antiAdBlocker = true;
     $this->author = self::between('<span itemprop="author">', '</span');
 }
開發者ID:dereckson,項目名稱:source-templates-generator,代碼行數:10,代碼來源:losangelestimes.php

示例6: analyse

 /**
  * Analyses the page and extracts metadata
  */
 function analyse()
 {
     parent::analyse();
     $this->site = "[[Le Huffington Post]]";
     $this->author = self::between('<a class="author-card__details__name">', '</a>');
     $this->extractYYYYMMDDDateFromURL();
 }
開發者ID:dereckson,項目名稱:source-templates-generator,代碼行數:10,代碼來源:huffingtonpostfrance.php

示例7: analyse

 function analyse()
 {
     parent::analyse();
     $this->publisher = 'Taylor & Francis';
     //DOI
     $this->doi = self::between('meta name="dc.Identifier" scheme="doi" content="', '"');
     //Gets the right dc.Identifier (coden scheme)
     //Expected format: <Issue name>, Vol. <Issue volume>, No. <Issue number>, <Issue date>, pp. <article pages>
     //e.g. Annals of Science, Vol. 68, No. 3, July 2011, pp. 325–350
     $identifier = self::between('meta name="dc.Identifier" scheme="coden" content="', '"');
     $identifier_data = explode(', ', $identifier);
     $pos = strpos($identifier, ", Vol. ");
     $this->journal = substr($identifier, 0, $pos);
     $this->volume = self::grab($identifier, "Vol. ", ",");
     $this->issue = self::grab($identifier, "No. ", ",");
     $date = explode(' ', $identifier_data[3]);
     $this->yyyy = array_pop($date);
     $pos = strpos($identifier, "pp. ");
     $this->pages = substr($identifier, $pos + 4);
     //Author
     //TODO: handle several authors
     $author = trim(self::getMetaTag($this->meta_tags, 'dc.Creator'));
     $names = explode('   ', $author);
     if (count($names) == 2) {
         $this->author = "{$names['1']}, {$names['0']}";
     } else {
         $this->author = $author;
     }
 }
開發者ID:dereckson,項目名稱:source-templates-generator,代碼行數:29,代碼來源:taylorandfrancis.php

示例8: analyse

 /**
  * Analyses the page and extracts metadata
  */
 function analyse()
 {
     parent::analyse();
     $author = self::between('<span itemprop="author">', '</span>');
     $this->author = name_case($author);
     $this->extractDate();
     $this->site = "[[L'Avenir (Belgique)|L'Avenir]]";
 }
開發者ID:dereckson,項目名稱:source-templates-generator,代碼行數:11,代碼來源:lavenir.php

示例9: analyse

 function analyse()
 {
     parent::analyse();
     //Fixing citation_doi metatag bug
     //<meta name="citation_doi" content="&#10;                    10.7202/012719ar" />
     $doi = str_replace('&#10;', '', $this->meta_tags['citation_doi']);
     $this->meta_tags['citation_doi'] = trim($doi);
 }
開發者ID:dereckson,項目名稱:source-templates-generator,代碼行數:8,代碼來源:erudit.php

示例10: analyse

 /**
  * Analyses the page and extracts metadata
  */
 function analyse()
 {
     parent::analyse();
     $authorElement = self::between('<div class="byline">', '</div>');
     $this->author = self::grab($authorElement, '">', '</a>');
     $this->extractYYYYMMDDDateFromURL();
     $this->site = "[[Crunchyroll]]";
 }
開發者ID:dereckson,項目名稱:source-templates-generator,代碼行數:11,代碼來源:crunchyroll.php

示例11: analyse

 /**
  * Analyses the page and extracts metadata
  */
 function analyse()
 {
     parent::analyse();
     $this->skipAuthor = true;
     $this->title = $this->getTitle();
     $this->yyyy = $this->getYear();
     $this->skipMD = true;
     $this->site = "Formula 1";
 }
開發者ID:dereckson,項目名稱:source-templates-generator,代碼行數:12,代碼來源:formula1.php

示例12: analyse

 function analyse()
 {
     parent::analyse();
     //Hardcoded known info
     $this->site = "Les Chroniques Automatiques";
     $this->author = "Dat’";
     //Gets date
     $this->dateFromDateParse(trim(self::between('This entry was posted	on', 'and is filed under')));
 }
開發者ID:dereckson,項目名稱:source-templates-generator,代碼行數:9,代碼來源:leschroniquesautomatiques.php

示例13: analyse

 function analyse()
 {
     parent::analyse();
     $this->site = "[[Le Soir]]";
     if ($this->isArchive()) {
         $this->analyseForArchive();
     } else {
         $this->analyseForMainSite();
     }
 }
開發者ID:dereckson,項目名稱:source-templates-generator,代碼行數:10,代碼來源:lesoir.php

示例14: analyse

 function analyse()
 {
     parent::analyse();
     //Hardcoded known info
     $this->site = "[[Le Monde]]";
     $this->issn = '1950-6244';
     //Gets date
     // e.g. http://www.lemonde.fr/ameriques/article/2013/05/25/le-bresil-annule-la-dette-de-douze-pays-africains_3417518_3222.html
     $pos = strpos($this->url, "/article/");
     $this->yyyy = substr($this->url, $pos + 9, 4);
     $this->mm = substr($this->url, $pos + 14, 2);
     $this->dd = substr($this->url, $pos + 17, 2);
     $this->author = $this->getAuthor();
 }
開發者ID:dereckson,項目名稱:source-templates-generator,代碼行數:14,代碼來源:lemonde.php

示例15: analyse

 /**
  * Analyses the page and extracts metadata
  */
 function analyse()
 {
     parent::analyse();
     // Hardcoded known info
     $this->site = "[[Le Parisien]]";
     // From metadata
     $this->dateFromDateParse($this->meta_tags['article:published_time']);
     $author = $this->meta_tags['creator'];
     if ($author === "Le Parisien") {
         $this->skipAuthor = true;
     } else {
         $this->author = $author;
     }
 }
開發者ID:dereckson,項目名稱:source-templates-generator,代碼行數:17,代碼來源:leparisien.php


注:本文中的Page::analyse方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。