1 | <?php |
||
10 | trait StandardEntity { |
||
11 | |||
12 | /** |
||
13 | * Alias for getLang() |
||
14 | * @see getLang() |
||
15 | * @return string |
||
16 | */ |
||
17 | 1 | public function getHumanLanguage() |
|
21 | |||
22 | /** |
||
23 | * Returns the human language of the page as determined by Diffbot when looking at content. |
||
24 | * The code returned is a two-character ISO 639-1 code: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes |
||
25 | * @return string |
||
26 | */ |
||
27 | 1 | public function getLang() |
|
31 | |||
32 | /** |
||
33 | * Returns the URL which was crawled |
||
34 | * @return string |
||
35 | */ |
||
36 | 2 | public function getPageUrl() |
|
40 | |||
41 | /** |
||
42 | * Returns page Url which was resolved by redirects, if any. |
||
43 | * For example, crawling a bitly link will make this method return the ultimate destination's URL |
||
44 | * @return string |
||
45 | */ |
||
46 | 1 | public function getResolvedPageUrl() |
|
50 | |||
51 | /** |
||
52 | * Returns title of article as deduced by Diffbot |
||
53 | * @return string |
||
54 | */ |
||
55 | 1 | public function getTitle() |
|
59 | |||
60 | /** |
||
61 | * Returns an array of all links found on the crawled page. |
||
62 | * |
||
63 | * Only available in the standard APIs, not Custom APIs |
||
64 | * @return array|null |
||
65 | */ |
||
66 | 1 | public function getLinks() |
|
70 | |||
71 | /** |
||
72 | * Returns a top-level object (meta) containing the full contents of page meta tags, |
||
73 | * including sub-arrays for OpenGraph tags, Twitter Card metadata, schema.org microdata, |
||
74 | * and -- if available -- oEmbed metadata. |
||
75 | * |
||
76 | * Only available in the standard APIs, not Custom APIs |
||
77 | * @return array|null |
||
78 | */ |
||
79 | 1 | public function getMeta() |
|
83 | |||
84 | /** |
||
85 | * Returns any key/value pairs present in the URL querystring. |
||
86 | * Items without a discrete value will be returned as true. |
||
87 | * |
||
88 | * Only available in the standard APIs, not Custom APIs |
||
89 | * @return array|null |
||
90 | */ |
||
91 | 1 | public function getQueryString() |
|
95 | |||
96 | /** |
||
97 | * Returns a top-level array (breadcrumb) of URLs and link text from page breadcrumbs. |
||
98 | * |
||
99 | * Only available in the standard APIs, not Custom APIs |
||
100 | * @return array|null |
||
101 | */ |
||
102 | 1 | public function getBreadcrumb() |
|
106 | |||
107 | /** |
||
108 | * An internal identifier for Diffbot, used for indexing in their databases |
||
109 | * @return string |
||
110 | */ |
||
111 | 1 | public function getDiffbotUri() |
|
115 | |||
116 | /** |
||
117 | * Returns the timestamp from the point in time the page was indexed by the engine |
||
118 | * Example date: "Wed, 18 Dec 2013 00:00:00 GMT" |
||
119 | * This will be a Carbon (https://github.com/briannesbitt/Carbon) instance if Carbon is installed. |
||
120 | * @return \Carbon\Carbon | string |
||
121 | */ |
||
122 | public function getTimestamp() |
||
128 | |||
129 | 24 | protected function getOrDefault($key, $default = null, $data = null) |
|
134 | |||
135 | } |
||
136 |