Skip to content

Commit

Permalink
Update Twitter.php
Browse files Browse the repository at this point in the history
Adds back the new twitter URL
  • Loading branch information
rowasc committed May 5, 2020
1 parent 8e72672 commit eb1e3a7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/App/DataSource/Twitter/Twitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,23 @@ public function fetch($limit = false)
) {
continue;
}
$user_id = $user['id_str'];
// @todo Check for similar messages in the database before saving
/***
* Twitter links note: (message field)
* Best compromise I could find was just make the proper urls with user_id rather than only
* tweet id (for which there is an unofficial formula)...
* since there doesn't seem to be a way to grab the URL from the
* API itself in the v1.1 search endpoint.
* Fun fact: if the user id is wrong, twitter
* still takes you to the correct Tweet... they just use the tweet id
**/
$messages[] = [
'type' => MessageType::TWITTER,
'contact_type' => Contact::TWITTER,
'from' => $user['id_str'],
'from' => $user_id,
'to' => null,
'message' => 'https://twitter.com/statuses/' . $id,
'message' => "https://twitter.com/$user_id/status/$id",
'title' => 'From twitter on ' . $date,
'datetime' => $date,
'data_source_message_id' => $id,
Expand Down

0 comments on commit eb1e3a7

Please sign in to comment.