File tree 2 files changed +23
-1
lines changed
2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -275,4 +275,13 @@ public function getEstimatedDate()
275
275
new \Carbon \Carbon ($ date , 'GMT ' ) :
276
276
$ date ;
277
277
}
278
+
279
+ /**
280
+ * Returns the canonical url from a page, if any.
281
+ * @return string
282
+ */
283
+ public function getCanonicalUrl ()
284
+ {
285
+ return isset ($ this ->data ['canonicalUrl ' ]) ? $ this ->data ['canonicalUrl ' ] : null ;
286
+ }
278
287
}
Original file line number Diff line number Diff line change @@ -113,10 +113,23 @@ public function getDiffbotUri()
113
113
return $ this ->data ['diffbotUri ' ];
114
114
}
115
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 ()
123
+ {
124
+ return (class_exists ('\Carbon\Carbon ' )) ?
125
+ new \Carbon \Carbon ($ this ->data ['timestamp ' ], 'GMT ' ) :
126
+ $ this ->data ['timestamp ' ];
127
+ }
128
+
116
129
protected function getOrDefault ($ key , $ default = null , $ data = null )
117
130
{
118
131
$ data = ($ data !== null ) ?: $ this ->data ;
119
132
return (isset ($ data [$ key ]) ? $ data [$ key ] : $ default );
120
133
}
121
134
122
- }
135
+ }
You can’t perform that action at this time.
0 commit comments