mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	bugdown: Fetch complete data for tweet.
This makes an extended instead of a normal query, resulting in the full text of a tweet being fetched instead of just a truncated version.
This commit is contained in:
		@@ -230,7 +230,7 @@ def fetch_tweet_data(tweet_id):
 | 
			
		||||
            return None
 | 
			
		||||
 | 
			
		||||
        try:
 | 
			
		||||
            api = twitter.Api(**creds)
 | 
			
		||||
            api = twitter.Api(tweet_mode='extended', **creds)
 | 
			
		||||
            # Sometimes Twitter hangs on responses.  Timing out here
 | 
			
		||||
            # will cause the Tweet to go through as-is with no inline
 | 
			
		||||
            # preview, rather than having the message be rejected
 | 
			
		||||
@@ -604,7 +604,7 @@ class InlineInterestingLinkProcessor(markdown.treeprocessors.Treeprocessor):
 | 
			
		||||
            image_url = user.get('profile_image_url_https', user['profile_image_url'])
 | 
			
		||||
            profile_img.set('src', image_url)
 | 
			
		||||
 | 
			
		||||
            text = html.unescape(res['text'])
 | 
			
		||||
            text = html.unescape(res['full_text'])
 | 
			
		||||
            urls = res.get('urls', [])
 | 
			
		||||
            user_mentions = res.get('user_mentions', [])
 | 
			
		||||
            media = res.get('media', [])  # type: List[Dict[Text, Any]]
 | 
			
		||||
 
 | 
			
		||||
@@ -5,217 +5,220 @@ import ujson
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
NORMAL_TWEET = """{
 | 
			
		||||
  "created_at": "Sat Sep 10 22:23:38 +0000 2011",
 | 
			
		||||
  "id_str": "112652479837110273",
 | 
			
		||||
  "in_reply_to_user_id_str": "783214",
 | 
			
		||||
  "text": "@twitter meets @seepicturely at #tcdisrupt cc.@boscomonkey @episod http://t.co/6J2EgYM",
 | 
			
		||||
  "source": "<a href=\\"http://instagram.com\\" rel=\\"nofollow\\">Instagram</a>",
 | 
			
		||||
  "lang": "en",
 | 
			
		||||
  "id": 112652479837110273,
 | 
			
		||||
  "in_reply_to_user_id": 783214,
 | 
			
		||||
  "favorite_count": 3,
 | 
			
		||||
  "hashtags": [
 | 
			
		||||
    {
 | 
			
		||||
      "text": "tcdisrupt"
 | 
			
		||||
    }
 | 
			
		||||
  ],
 | 
			
		||||
  "user": {
 | 
			
		||||
    "profile_sidebar_fill_color": "efefef",
 | 
			
		||||
    "name": "Eoin McMillan ",
 | 
			
		||||
    "profile_image_url": "http://a1.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png",
 | 
			
		||||
    "created_at": "Mon May 16 20:07:59 +0000 2011",
 | 
			
		||||
    "location": "Twitter",
 | 
			
		||||
    "profile_link_color": "009999",
 | 
			
		||||
    "id_str": "299862462",
 | 
			
		||||
    "favourites_count": 0,
 | 
			
		||||
    "url": "http://www.eoin.me",
 | 
			
		||||
    "id": 299862462,
 | 
			
		||||
    "utc_offset": null,
 | 
			
		||||
    "profile_image_url_https": "https://si0.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png",
 | 
			
		||||
    "listed_count": 0,
 | 
			
		||||
    "followers_count": 9,
 | 
			
		||||
    "created_at": "Sat Sep 10 22:23:38 +0000 2011",
 | 
			
		||||
    "favorite_count": 1,
 | 
			
		||||
    "full_text": "@twitter meets @seepicturely at #tcdisrupt cc.@boscomonkey @episod http://t.co/6J2EgYM",
 | 
			
		||||
    "hashtags": [
 | 
			
		||||
        {
 | 
			
		||||
            "text": "tcdisrupt"
 | 
			
		||||
        }
 | 
			
		||||
    ],
 | 
			
		||||
    "id": 112652479837110270,
 | 
			
		||||
    "id_str": "112652479837110273",
 | 
			
		||||
    "in_reply_to_screen_name": "Twitter",
 | 
			
		||||
    "in_reply_to_user_id": 783214,
 | 
			
		||||
    "lang": "en",
 | 
			
		||||
    "profile_text_color": "333333",
 | 
			
		||||
    "profile_background_image_url_https": "https://si0.twimg.com/images/themes/theme14/bg.gif",
 | 
			
		||||
    "description": "Eoin's photography account. See @mceoin for tweets.",
 | 
			
		||||
    "geo_enabled": false,
 | 
			
		||||
    "profile_background_color": "131516",
 | 
			
		||||
    "time_zone": null,
 | 
			
		||||
    "statuses_count": 255,
 | 
			
		||||
    "friends_count": 0,
 | 
			
		||||
    "profile_background_image_url": "http://a1.twimg.com/images/themes/theme14/bg.gif",
 | 
			
		||||
    "screen_name": "imeoin",
 | 
			
		||||
    "statuses_count": 270
 | 
			
		||||
  },
 | 
			
		||||
  "user_mentions": [
 | 
			
		||||
    {
 | 
			
		||||
      "screen_name": "twitter",
 | 
			
		||||
      "name": "Twitter",
 | 
			
		||||
      "id": 1
 | 
			
		||||
    "retweet_count": 4,
 | 
			
		||||
    "source": "<a href=\\"http://instagram.com\\" rel=\\"nofollow\\">Instagram</a>",
 | 
			
		||||
    "urls": [
 | 
			
		||||
        {
 | 
			
		||||
            "expanded_url": "http://instagr.am/p/MuW67/",
 | 
			
		||||
            "url": "http://t.co/6J2EgYM"
 | 
			
		||||
        }
 | 
			
		||||
    ],
 | 
			
		||||
    "user": {
 | 
			
		||||
        "created_at": "Mon May 16 20:07:59 +0000 2011",
 | 
			
		||||
        "description": "Eoin's photography account. See @mceoin for tweets.",
 | 
			
		||||
        "followers_count": 3,
 | 
			
		||||
        "id": 299862462,
 | 
			
		||||
        "lang": "en",
 | 
			
		||||
        "location": "Twitter",
 | 
			
		||||
        "name": "Eoin McMillan",
 | 
			
		||||
        "profile_background_color": "131516",
 | 
			
		||||
        "profile_background_image_url": "http://abs.twimg.com/images/themes/theme14/bg.gif",
 | 
			
		||||
        "profile_background_tile": true,
 | 
			
		||||
        "profile_image_url": "http://pbs.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png",
 | 
			
		||||
        "profile_link_color": "009999",
 | 
			
		||||
        "profile_sidebar_fill_color": "EFEFEF",
 | 
			
		||||
        "profile_text_color": "333333",
 | 
			
		||||
        "screen_name": "imeoin",
 | 
			
		||||
        "statuses_count": 278,
 | 
			
		||||
        "url": "http://t.co/p9hKpiGMyN"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "screen_name": "boscomonkey",
 | 
			
		||||
      "name": "Bosco So",
 | 
			
		||||
      "id": 2
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "screen_name": "episod",
 | 
			
		||||
      "name": "Taylor Singletary",
 | 
			
		||||
      "id": 3
 | 
			
		||||
    }
 | 
			
		||||
   ],
 | 
			
		||||
  "urls": [
 | 
			
		||||
    {
 | 
			
		||||
      "expanded_url": "http://instagram.com/p/MuW67/",
 | 
			
		||||
      "url": "http://t.co/6J2EgYM"
 | 
			
		||||
    }
 | 
			
		||||
  ]
 | 
			
		||||
    "user_mentions": [
 | 
			
		||||
        {
 | 
			
		||||
            "id": 783214,
 | 
			
		||||
            "name": "Twitter",
 | 
			
		||||
            "screen_name": "Twitter"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
            "id": 14792670,
 | 
			
		||||
            "name": "Bosco So",
 | 
			
		||||
            "screen_name": "boscomonkey"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
            "id": 819797,
 | 
			
		||||
            "name": "Taylor Singletary",
 | 
			
		||||
            "screen_name": "episod"
 | 
			
		||||
        }
 | 
			
		||||
    ]
 | 
			
		||||
}"""
 | 
			
		||||
 | 
			
		||||
MENTION_IN_LINK_TWEET = """{
 | 
			
		||||
  "created_at": "Sat Sep 10 22:23:38 +0000 2011",
 | 
			
		||||
  "id_str": "112652479837110273",
 | 
			
		||||
  "in_reply_to_user_id_str": "783214",
 | 
			
		||||
  "text": "http://t.co/@foo",
 | 
			
		||||
  "source": "<a href=\\"http://twitter.com\\" rel=\\"nofollow\\">Twitter Web Client</a>",
 | 
			
		||||
  "lang": "en",
 | 
			
		||||
  "id": 112652479837110273,
 | 
			
		||||
  "in_reply_to_user_id": 783214,
 | 
			
		||||
  "favorite_count": 3,
 | 
			
		||||
  "user": {
 | 
			
		||||
    "profile_sidebar_fill_color": "efefef",
 | 
			
		||||
    "name": "Eoin McMillan ",
 | 
			
		||||
    "profile_image_url": "http://a1.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png",
 | 
			
		||||
    "created_at": "Mon May 16 20:07:59 +0000 2011",
 | 
			
		||||
    "location": "Twitter",
 | 
			
		||||
    "profile_link_color": "009999",
 | 
			
		||||
    "id_str": "299862462",
 | 
			
		||||
    "favourites_count": 0,
 | 
			
		||||
    "url": "http://www.eoin.me",
 | 
			
		||||
    "id": 299862462,
 | 
			
		||||
    "utc_offset": null,
 | 
			
		||||
    "profile_image_url_https": "https://si0.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png",
 | 
			
		||||
    "listed_count": 0,
 | 
			
		||||
    "followers_count": 9,
 | 
			
		||||
    "created_at": "Sat Sep 10 22:23:38 +0000 2011",
 | 
			
		||||
    "favorite_count": 1,
 | 
			
		||||
    "full_text": "http://t.co/@foo",
 | 
			
		||||
    "hashtags": [
 | 
			
		||||
        {
 | 
			
		||||
            "text": "tcdisrupt"
 | 
			
		||||
        }
 | 
			
		||||
    ],
 | 
			
		||||
    "id": 112652479837110270,
 | 
			
		||||
    "id_str": "112652479837110273",
 | 
			
		||||
    "in_reply_to_screen_name": "Twitter",
 | 
			
		||||
    "in_reply_to_user_id": 783214,
 | 
			
		||||
    "lang": "en",
 | 
			
		||||
    "profile_text_color": "333333",
 | 
			
		||||
    "profile_background_image_url_https": "https://si0.twimg.com/images/themes/theme14/bg.gif",
 | 
			
		||||
    "description": "Eoin's photography account. See @mceoin for tweets.",
 | 
			
		||||
    "geo_enabled": false,
 | 
			
		||||
    "profile_background_color": "131516",
 | 
			
		||||
    "time_zone": null,
 | 
			
		||||
    "statuses_count": 255,
 | 
			
		||||
    "friends_count": 0,
 | 
			
		||||
    "profile_background_image_url": "http://a1.twimg.com/images/themes/theme14/bg.gif",
 | 
			
		||||
    "screen_name": "imeoin",
 | 
			
		||||
    "statuses_count": 270
 | 
			
		||||
  },
 | 
			
		||||
  "user_mentions": [
 | 
			
		||||
    {
 | 
			
		||||
      "screen_name": "foo",
 | 
			
		||||
      "name": "Foo",
 | 
			
		||||
      "id": 1
 | 
			
		||||
    }
 | 
			
		||||
   ],
 | 
			
		||||
  "urls": [
 | 
			
		||||
    {
 | 
			
		||||
      "expanded_url": "http://foo.com",
 | 
			
		||||
      "url": "http://t.co/@foo"
 | 
			
		||||
    }
 | 
			
		||||
  ]
 | 
			
		||||
    "retweet_count": 4,
 | 
			
		||||
    "source": "<a href=\\"http://instagram.com\\" rel=\\"nofollow\\">Instagram</a>",
 | 
			
		||||
    "urls": [
 | 
			
		||||
      {
 | 
			
		||||
        "expanded_url": "http://foo.com",
 | 
			
		||||
        "url": "http://t.co/@foo"
 | 
			
		||||
      }
 | 
			
		||||
    ],
 | 
			
		||||
    "user": {
 | 
			
		||||
        "created_at": "Mon May 16 20:07:59 +0000 2011",
 | 
			
		||||
        "description": "Eoin's photography account. See @mceoin for tweets.",
 | 
			
		||||
        "followers_count": 3,
 | 
			
		||||
        "id": 299862462,
 | 
			
		||||
        "lang": "en",
 | 
			
		||||
        "location": "Twitter",
 | 
			
		||||
        "name": "Eoin McMillan",
 | 
			
		||||
        "profile_background_color": "131516",
 | 
			
		||||
        "profile_background_image_url": "http://abs.twimg.com/images/themes/theme14/bg.gif",
 | 
			
		||||
        "profile_background_tile": true,
 | 
			
		||||
        "profile_image_url": "http://pbs.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png",
 | 
			
		||||
        "profile_link_color": "009999",
 | 
			
		||||
        "profile_sidebar_fill_color": "EFEFEF",
 | 
			
		||||
        "profile_text_color": "333333",
 | 
			
		||||
        "screen_name": "imeoin",
 | 
			
		||||
        "statuses_count": 278,
 | 
			
		||||
        "url": "http://t.co/p9hKpiGMyN"
 | 
			
		||||
    },
 | 
			
		||||
    "user_mentions": [
 | 
			
		||||
        {
 | 
			
		||||
            "id": 783214,
 | 
			
		||||
            "name": "Foo",
 | 
			
		||||
            "screen_name": "foo"
 | 
			
		||||
        }
 | 
			
		||||
    ]
 | 
			
		||||
}"""
 | 
			
		||||
 | 
			
		||||
MEDIA_TWEET = """{
 | 
			
		||||
  "created_at": "Sat Sep 10 22:23:38 +0000 2011",
 | 
			
		||||
  "id_str": "112652479837110273",
 | 
			
		||||
  "in_reply_to_user_id_str": "783214",
 | 
			
		||||
  "text": "http://t.co/xo7pAhK6n3",
 | 
			
		||||
  "source": "<a href=\\"http://twitter.com\\" rel=\\"nofollow\\">Twitter Web Client</a>",
 | 
			
		||||
  "lang": "en",
 | 
			
		||||
  "id": 112652479837110273,
 | 
			
		||||
  "in_reply_to_user_id": 783214,
 | 
			
		||||
  "favorite_count": 3,
 | 
			
		||||
  "user": {
 | 
			
		||||
    "profile_sidebar_fill_color": "efefef",
 | 
			
		||||
    "name": "Eoin McMillan ",
 | 
			
		||||
    "profile_image_url": "http://a1.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png",
 | 
			
		||||
    "created_at": "Mon May 16 20:07:59 +0000 2011",
 | 
			
		||||
    "location": "Twitter",
 | 
			
		||||
    "profile_link_color": "009999",
 | 
			
		||||
    "id_str": "299862462",
 | 
			
		||||
    "favourites_count": 0,
 | 
			
		||||
    "url": "http://www.eoin.me",
 | 
			
		||||
    "id": 299862462,
 | 
			
		||||
    "utc_offset": null,
 | 
			
		||||
    "profile_image_url_https": "https://si0.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png",
 | 
			
		||||
    "listed_count": 0,
 | 
			
		||||
    "followers_count": 9,
 | 
			
		||||
    "created_at": "Sat Sep 10 22:23:38 +0000 2011",
 | 
			
		||||
    "favorite_count": 1,
 | 
			
		||||
    "full_text": "http://t.co/xo7pAhK6n3",
 | 
			
		||||
    "id": 112652479837110270,
 | 
			
		||||
    "id_str": "112652479837110273",
 | 
			
		||||
    "in_reply_to_screen_name": "Twitter",
 | 
			
		||||
    "in_reply_to_user_id": 783214,
 | 
			
		||||
    "lang": "en",
 | 
			
		||||
    "profile_text_color": "333333",
 | 
			
		||||
    "profile_background_image_url_https": "https://si0.twimg.com/images/themes/theme14/bg.gif",
 | 
			
		||||
    "description": "Eoin's photography account. See @mceoin for tweets.",
 | 
			
		||||
    "geo_enabled": false,
 | 
			
		||||
    "profile_background_color": "131516",
 | 
			
		||||
    "time_zone": null,
 | 
			
		||||
    "statuses_count": 255,
 | 
			
		||||
    "friends_count": 0,
 | 
			
		||||
    "profile_background_image_url": "http://a1.twimg.com/images/themes/theme14/bg.gif",
 | 
			
		||||
    "screen_name": "imeoin",
 | 
			
		||||
    "statuses_count": 270
 | 
			
		||||
  },
 | 
			
		||||
  "media": [
 | 
			
		||||
    {
 | 
			
		||||
      "display_url": "pic.twitter.com/xo7pAhK6n3",
 | 
			
		||||
      "expanded_url": "http://twitter.com/NEVNBoston/status/421654515616849920/photo/1",
 | 
			
		||||
      "id": 421654515495211010,
 | 
			
		||||
      "media_url": "http://pbs.twimg.com/media/BdoEjD4IEAIq86Z.jpg",
 | 
			
		||||
      "media_url_https": "https://pbs.twimg.com/media/BdoEjD4IEAIq86Z.jpg",
 | 
			
		||||
      "sizes": {"large": {"h": 700, "resize": "fit", "w": 1024},
 | 
			
		||||
                 "medium": {"h": 410, "resize": "fit", "w": 599},
 | 
			
		||||
                 "small": {"h": 232, "resize": "fit", "w": 340},
 | 
			
		||||
                 "thumb": {"h": 150, "resize": "crop", "w": 150}},
 | 
			
		||||
      "type": "photo",
 | 
			
		||||
      "url": "http://t.co/xo7pAhK6n3"}
 | 
			
		||||
  ]
 | 
			
		||||
    "media": [
 | 
			
		||||
      {
 | 
			
		||||
        "display_url": "pic.twitter.com/xo7pAhK6n3",
 | 
			
		||||
        "expanded_url": "http://twitter.com/NEVNBoston/status/421654515616849920/photo/1",
 | 
			
		||||
        "id": 421654515495211010,
 | 
			
		||||
        "media_url": "http://pbs.twimg.com/media/BdoEjD4IEAIq86Z.jpg",
 | 
			
		||||
        "media_url_https": "https://pbs.twimg.com/media/BdoEjD4IEAIq86Z.jpg",
 | 
			
		||||
        "sizes": {"large": {"h": 700, "resize": "fit", "w": 1024},
 | 
			
		||||
                   "medium": {"h": 410, "resize": "fit", "w": 599},
 | 
			
		||||
                   "small": {"h": 232, "resize": "fit", "w": 340},
 | 
			
		||||
                   "thumb": {"h": 150, "resize": "crop", "w": 150}},
 | 
			
		||||
        "type": "photo",
 | 
			
		||||
        "url": "http://t.co/xo7pAhK6n3"}
 | 
			
		||||
    ],
 | 
			
		||||
    "retweet_count": 4,
 | 
			
		||||
    "source": "<a href=\\"http://instagram.com\\" rel=\\"nofollow\\">Instagram</a>",
 | 
			
		||||
    "user": {
 | 
			
		||||
        "created_at": "Mon May 16 20:07:59 +0000 2011",
 | 
			
		||||
        "description": "Eoin's photography account. See @mceoin for tweets.",
 | 
			
		||||
        "followers_count": 3,
 | 
			
		||||
        "id": 299862462,
 | 
			
		||||
        "lang": "en",
 | 
			
		||||
        "location": "Twitter",
 | 
			
		||||
        "name": "Eoin McMillan",
 | 
			
		||||
        "profile_background_color": "131516",
 | 
			
		||||
        "profile_background_image_url": "http://abs.twimg.com/images/themes/theme14/bg.gif",
 | 
			
		||||
        "profile_background_tile": true,
 | 
			
		||||
        "profile_image_url": "http://pbs.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png",
 | 
			
		||||
        "profile_link_color": "009999",
 | 
			
		||||
        "profile_sidebar_fill_color": "EFEFEF",
 | 
			
		||||
        "profile_text_color": "333333",
 | 
			
		||||
        "screen_name": "imeoin",
 | 
			
		||||
        "statuses_count": 278,
 | 
			
		||||
        "url": "http://t.co/p9hKpiGMyN"
 | 
			
		||||
    },
 | 
			
		||||
    "user_mentions": [
 | 
			
		||||
        {
 | 
			
		||||
            "id": 783214,
 | 
			
		||||
            "name": "Foo",
 | 
			
		||||
            "screen_name": "foo"
 | 
			
		||||
        }
 | 
			
		||||
    ]
 | 
			
		||||
}"""
 | 
			
		||||
 | 
			
		||||
EMOJI_TWEET = """{
 | 
			
		||||
  "created_at": "Sat Sep 10 22:23:38 +0000 2011",
 | 
			
		||||
  "id_str": "287977969287315460",
 | 
			
		||||
  "in_reply_to_user_id_str": "783214",
 | 
			
		||||
  "text": "Zulip is 💯% open-source!",
 | 
			
		||||
  "lang": "en",
 | 
			
		||||
  "id": 287977969287315460,
 | 
			
		||||
  "in_reply_to_user_id": 783214,
 | 
			
		||||
  "favorite_count": 3,
 | 
			
		||||
  "user": {
 | 
			
		||||
    "profile_sidebar_fill_color": "efefef",
 | 
			
		||||
    "name": "Eoin McMillan ",
 | 
			
		||||
    "profile_image_url": "http://a1.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png",
 | 
			
		||||
    "created_at": "Mon May 16 20:07:59 +0000 2011",
 | 
			
		||||
    "location": "Twitter",
 | 
			
		||||
    "profile_link_color": "009999",
 | 
			
		||||
    "id_str": "299862462",
 | 
			
		||||
    "favourites_count": 0,
 | 
			
		||||
    "url": "http://www.eoin.me",
 | 
			
		||||
    "id": 299862462,
 | 
			
		||||
    "utc_offset": null,
 | 
			
		||||
    "profile_image_url_https": "https://si0.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png",
 | 
			
		||||
    "listed_count": 0,
 | 
			
		||||
    "followers_count": 9,
 | 
			
		||||
    "created_at": "Sat Sep 10 22:23:38 +0000 2011",
 | 
			
		||||
    "favorite_count": 1,
 | 
			
		||||
    "full_text": "Zulip is 💯% open-source!",
 | 
			
		||||
    "hashtags": [
 | 
			
		||||
        {
 | 
			
		||||
            "text": "tcdisrupt"
 | 
			
		||||
        }
 | 
			
		||||
    ],
 | 
			
		||||
    "id": 112652479837110270,
 | 
			
		||||
    "id_str": "112652479837110273",
 | 
			
		||||
    "in_reply_to_screen_name": "Twitter",
 | 
			
		||||
    "in_reply_to_user_id": 783214,
 | 
			
		||||
    "lang": "en",
 | 
			
		||||
    "profile_text_color": "333333",
 | 
			
		||||
    "profile_background_image_url_https": "https://si0.twimg.com/images/themes/theme14/bg.gif",
 | 
			
		||||
    "description": "Eoin's photography account. See @mceoin for tweets.",
 | 
			
		||||
    "geo_enabled": false,
 | 
			
		||||
    "profile_background_color": "131516",
 | 
			
		||||
    "time_zone": null,
 | 
			
		||||
    "statuses_count": 255,
 | 
			
		||||
    "friends_count": 0,
 | 
			
		||||
    "profile_background_image_url": "http://a1.twimg.com/images/themes/theme14/bg.gif",
 | 
			
		||||
    "screen_name": "imeoin",
 | 
			
		||||
    "statuses_count": 270
 | 
			
		||||
  }
 | 
			
		||||
    "retweet_count": 4,
 | 
			
		||||
    "source": "<a href=\\"http://instagram.com\\" rel=\\"nofollow\\">Instagram</a>",
 | 
			
		||||
    "user": {
 | 
			
		||||
        "created_at": "Mon May 16 20:07:59 +0000 2011",
 | 
			
		||||
        "description": "Eoin's photography account. See @mceoin for tweets.",
 | 
			
		||||
        "followers_count": 3,
 | 
			
		||||
        "id": 299862462,
 | 
			
		||||
        "lang": "en",
 | 
			
		||||
        "location": "Twitter",
 | 
			
		||||
        "name": "Eoin McMillan",
 | 
			
		||||
        "profile_background_color": "131516",
 | 
			
		||||
        "profile_background_image_url": "http://abs.twimg.com/images/themes/theme14/bg.gif",
 | 
			
		||||
        "profile_background_tile": true,
 | 
			
		||||
        "profile_image_url": "http://pbs.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png",
 | 
			
		||||
        "profile_link_color": "009999",
 | 
			
		||||
        "profile_sidebar_fill_color": "EFEFEF",
 | 
			
		||||
        "profile_text_color": "333333",
 | 
			
		||||
        "screen_name": "imeoin",
 | 
			
		||||
        "statuses_count": 278,
 | 
			
		||||
        "url": "http://t.co/p9hKpiGMyN"
 | 
			
		||||
    },
 | 
			
		||||
    "user_mentions": [
 | 
			
		||||
        {
 | 
			
		||||
            "id": 783214,
 | 
			
		||||
            "name": "Twitter",
 | 
			
		||||
            "screen_name": "Twitter"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
            "id": 14792670,
 | 
			
		||||
            "name": "Bosco So",
 | 
			
		||||
            "screen_name": "boscomonkey"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
            "id": 819797,
 | 
			
		||||
            "name": "Taylor Singletary",
 | 
			
		||||
            "screen_name": "episod"
 | 
			
		||||
        }
 | 
			
		||||
    ]
 | 
			
		||||
}"""
 | 
			
		||||
 | 
			
		||||
def twitter(tweet_id):
 | 
			
		||||
 
 | 
			
		||||
@@ -435,15 +435,15 @@ class BugdownTest(ZulipTestCase):
 | 
			
		||||
            # type: (Text) -> Text
 | 
			
		||||
            return '<a href="%s" target="_blank" title="%s">%s</a>' % (url, url, url)
 | 
			
		||||
 | 
			
		||||
        normal_tweet_html = ('<a href="https://twitter.com/twitter" target="_blank"'
 | 
			
		||||
                             ' title="https://twitter.com/twitter">@twitter</a> '
 | 
			
		||||
        normal_tweet_html = ('<a href="https://twitter.com/Twitter" target="_blank"'
 | 
			
		||||
                             ' title="https://twitter.com/Twitter">@Twitter</a> '
 | 
			
		||||
                             'meets @seepicturely at #tcdisrupt cc.'
 | 
			
		||||
                             '<a href="https://twitter.com/boscomonkey" target="_blank"'
 | 
			
		||||
                             ' title="https://twitter.com/boscomonkey">@boscomonkey</a> '
 | 
			
		||||
                             '<a href="https://twitter.com/episod" target="_blank"'
 | 
			
		||||
                             ' title="https://twitter.com/episod">@episod</a> '
 | 
			
		||||
                             '<a href="http://t.co/6J2EgYM" target="_blank"'
 | 
			
		||||
                             ' title="http://t.co/6J2EgYM">http://instagram.com/p/MuW67/</a>')
 | 
			
		||||
                             ' title="http://t.co/6J2EgYM">http://instagr.am/p/MuW67/</a>')
 | 
			
		||||
 | 
			
		||||
        mention_in_link_tweet_html = """<a href="http://t.co/@foo" target="_blank" title="http://t.co/@foo">http://foo.com</a>"""
 | 
			
		||||
 | 
			
		||||
@@ -459,10 +459,12 @@ class BugdownTest(ZulipTestCase):
 | 
			
		||||
                    '<div class="twitter-tweet">'
 | 
			
		||||
                    '<a href="%s" target="_blank">'
 | 
			
		||||
                    '<img class="twitter-avatar"'
 | 
			
		||||
                    ' src="https://si0.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png">'
 | 
			
		||||
                    ' src="https://external-content.zulipcdn.net/1f7cd2436976d410eab8189ebceda87ae0b34ead/687474703a2f2f7062732e7477696d672e63'
 | 
			
		||||
                    '6f6d2f70726f66696c655f696d616765732f313338303931323137332f53637265656e5f73686f745f323031312d30362d30335f61745f372e33352e33'
 | 
			
		||||
                    '365f504d5f6e6f726d616c2e706e67">'
 | 
			
		||||
                    '</a>'
 | 
			
		||||
                    '<p>%s</p>'
 | 
			
		||||
                    '<span>- Eoin McMillan  (@imeoin)</span>'
 | 
			
		||||
                    '<span>- Eoin McMillan (@imeoin)</span>'
 | 
			
		||||
                    '%s'
 | 
			
		||||
                    '</div>'
 | 
			
		||||
                    '</div>') % (url, tweet_html, image_html)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user