diff options
author | Brion Vibber <brion@status.net> | 2010-11-12 17:40:34 -0800 |
---|---|---|
committer | Brion Vibber <brion@status.net> | 2010-11-12 17:40:34 -0800 |
commit | 398e622fecdb2b2b6bf6cde975e3978284db62b4 (patch) | |
tree | de69881f1f06b0f0903037c59189c5f8081e476e /plugins | |
parent | 2c33fdd2fb98c37798a80a8600798caa9dabcb0e (diff) |
Save attached URLs when importing a Twitter status: this lets our thumbnail detection handle photos and videos linked to by Twitter posters.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/TwitterBridge/twitterimport.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/TwitterBridge/twitterimport.php b/plugins/TwitterBridge/twitterimport.php index 07a9cf95f..498e9b1fc 100644 --- a/plugins/TwitterBridge/twitterimport.php +++ b/plugins/TwitterBridge/twitterimport.php @@ -189,6 +189,7 @@ class TwitterImport Notice_to_status::saveNew($notice->id, $status->id); $this->saveStatusMentions($notice, $status); + $this->saveStatusAttachments($notice, $status); $notice->blowOnInsert(); @@ -648,4 +649,20 @@ class TwitterImport } } } + + /** + * Record URL links from the notice. Needed to get thumbnail records + * for referenced photo and video posts, etc. + * + * @param Notice $notice + * @param object $status + */ + function saveStatusAttachments($notice, $status) + { + if (!empty($status->entities) && !empty($status->entities->urls)) { + foreach ($status->entities->urls as $url) { + File::processNew($url->url, $notice->id); + } + } + } }
\ No newline at end of file |