{"action":"created","comment":{"url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/pulls/comments/167482202","pull_request_review_id":95701463,"id":167482202,"diff_hunk":"@@ -113,3 +120,45 @@ def mention_markdown(user_id, name):\n     \"\"\"\n     if isinstance(user_id, int):\n         return '[{}](tg://user?id={})'.format(escape_markdown(name), user_id)\n+\n+\n+def _extract_urls_from_text(text):\n+    \"\"\"\n+    Returns a list of urls from a text string.\n+    URLs without a leading `http://` or `www.` won't be found.\n+    \"\"\"\n+    out = []\n+    for word in text.split(' '):\n+        thing = urlparse(word.strip())\n+        if thing.scheme:\n+            out.append(word)\n+    return out\n+\n+\n+def extract_urls(message):\n+    \"\"\"\n+    Extracts all Hyperlinks that are contained in a message. This includes\n+    message entities and the media caption. Distinct links are returned in order of appearance.","path":"telegram/utils/helpers.py","position":46,"original_position":46,"commit_id":"5c3d6bd9ab62acbb9ece8b44492b14159af704db","original_commit_id":"5c3d6bd9ab62acbb9ece8b44492b14159af704db","user":{"login":"tsnoam","id":7777017,"avatar_url":"https://avatars0.githubusercontent.com/u/7777017?v=4","gravatar_id":"","url":"https://api.github.com/users/tsnoam","html_url":"https://github.com/tsnoam","followers_url":"https://api.github.com/users/tsnoam/followers","following_url":"https://api.github.com/users/tsnoam/following{/other_user}","gists_url":"https://api.github.com/users/tsnoam/gists{/gist_id}","starred_url":"https://api.github.com/users/tsnoam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsnoam/subscriptions","organizations_url":"https://api.github.com/users/tsnoam/orgs","repos_url":"https://api.github.com/users/tsnoam/repos","events_url":"https://api.github.com/users/tsnoam/events{/privacy}","received_events_url":"https://api.github.com/users/tsnoam/received_events","type":"User","site_admin":false},"body":"Please clarify that message links will be always be specified before caption links.","created_at":"2018-02-12T07:46:40Z","updated_at":"2018-02-12T07:53:12Z","html_url":"https://github.com/python-telegram-bot/python-telegram-bot/pull/854#discussion_r167482202","pull_request_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/pulls/854","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/pulls/comments/167482202"},"html":{"href":"https://github.com/python-telegram-bot/python-telegram-bot/pull/854#discussion_r167482202"},"pull_request":{"href":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/pulls/854"}}},"pull_request":{"url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/pulls/854","id":144099761,"html_url":"https://github.com/python-telegram-bot/python-telegram-bot/pull/854","diff_url":"https://github.com/python-telegram-bot/python-telegram-bot/pull/854.diff","patch_url":"https://github.com/python-telegram-bot/python-telegram-bot/pull/854.patch","issue_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/issues/854","number":854,"state":"open","locked":false,"title":"Add extract_urls-helper","user":{"login":"JosXa","id":7313176,"avatar_url":"https://avatars3.githubusercontent.com/u/7313176?v=4","gravatar_id":"","url":"https://api.github.com/users/JosXa","html_url":"https://github.com/JosXa","followers_url":"https://api.github.com/users/JosXa/followers","following_url":"https://api.github.com/users/JosXa/following{/other_user}","gists_url":"https://api.github.com/users/JosXa/gists{/gist_id}","starred_url":"https://api.github.com/users/JosXa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JosXa/subscriptions","organizations_url":"https://api.github.com/users/JosXa/orgs","repos_url":"https://api.github.com/users/JosXa/repos","events_url":"https://api.github.com/users/JosXa/events{/privacy}","received_events_url":"https://api.github.com/users/JosXa/received_events","type":"User","site_admin":false},"body":"Added a new helper that extracts all URLs contained in a message and returned from Telegram ","created_at":"2017-10-02T01:49:50Z","updated_at":"2018-02-12T07:53:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1c0238f60b30be691a60da40b7681563b581da98","assignee":{"login":"JosXa","id":7313176,"avatar_url":"https://avatars3.githubusercontent.com/u/7313176?v=4","gravatar_id":"","url":"https://api.github.com/users/JosXa","html_url":"https://github.com/JosXa","followers_url":"https://api.github.com/users/JosXa/followers","following_url":"https://api.github.com/users/JosXa/following{/other_user}","gists_url":"https://api.github.com/users/JosXa/gists{/gist_id}","starred_url":"https://api.github.com/users/JosXa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JosXa/subscriptions","organizations_url":"https://api.github.com/users/JosXa/orgs","repos_url":"https://api.github.com/users/JosXa/repos","events_url":"https://api.github.com/users/JosXa/events{/privacy}","received_events_url":"https://api.github.com/users/JosXa/received_events","type":"User","site_admin":false},"assignees":[{"login":"JosXa","id":7313176,"avatar_url":"https://avatars3.githubusercontent.com/u/7313176?v=4","gravatar_id":"","url":"https://api.github.com/users/JosXa","html_url":"https://github.com/JosXa","followers_url":"https://api.github.com/users/JosXa/followers","following_url":"https://api.github.com/users/JosXa/following{/other_user}","gists_url":"https://api.github.com/users/JosXa/gists{/gist_id}","starred_url":"https://api.github.com/users/JosXa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JosXa/subscriptions","organizations_url":"https://api.github.com/users/JosXa/orgs","repos_url":"https://api.github.com/users/JosXa/repos","events_url":"https://api.github.com/users/JosXa/events{/privacy}","received_events_url":"https://api.github.com/users/JosXa/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"bomjacob","id":3002987,"avatar_url":"https://avatars1.githubusercontent.com/u/3002987?v=4","gravatar_id":"","url":"https://api.github.com/users/bomjacob","html_url":"https://github.com/bomjacob","followers_url":"https://api.github.com/users/bomjacob/followers","following_url":"https://api.github.com/users/bomjacob/following{/other_user}","gists_url":"https://api.github.com/users/bomjacob/gists{/gist_id}","starred_url":"https://api.github.com/users/bomjacob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bomjacob/subscriptions","organizations_url":"https://api.github.com/users/bomjacob/orgs","repos_url":"https://api.github.com/users/bomjacob/repos","events_url":"https://api.github.com/users/bomjacob/events{/privacy}","received_events_url":"https://api.github.com/users/bomjacob/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":233446072,"url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/pulls/854/commits","review_comments_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/pulls/854/comments","review_comment_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/issues/854/comments","statuses_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/statuses/5c3d6bd9ab62acbb9ece8b44492b14159af704db","head":{"label":"python-telegram-bot:extract-urls","ref":"extract-urls","sha":"5c3d6bd9ab62acbb9ece8b44492b14159af704db","user":{"login":"python-telegram-bot","id":16178365,"avatar_url":"https://avatars2.githubusercontent.com/u/16178365?v=4","gravatar_id":"","url":"https://api.github.com/users/python-telegram-bot","html_url":"https://github.com/python-telegram-bot","followers_url":"https://api.github.com/users/python-telegram-bot/followers","following_url":"https://api.github.com/users/python-telegram-bot/following{/other_user}","gists_url":"https://api.github.com/users/python-telegram-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/python-telegram-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python-telegram-bot/subscriptions","organizations_url":"https://api.github.com/users/python-telegram-bot/orgs","repos_url":"https://api.github.com/users/python-telegram-bot/repos","events_url":"https://api.github.com/users/python-telegram-bot/events{/privacy}","received_events_url":"https://api.github.com/users/python-telegram-bot/received_events","type":"Organization","site_admin":false},"repo":{"id":38696925,"name":"python-telegram-bot","full_name":"python-telegram-bot/python-telegram-bot","owner":{"login":"python-telegram-bot","id":16178365,"avatar_url":"https://avatars2.githubusercontent.com/u/16178365?v=4","gravatar_id":"","url":"https://api.github.com/users/python-telegram-bot","html_url":"https://github.com/python-telegram-bot","followers_url":"https://api.github.com/users/python-telegram-bot/followers","following_url":"https://api.github.com/users/python-telegram-bot/following{/other_user}","gists_url":"https://api.github.com/users/python-telegram-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/python-telegram-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python-telegram-bot/subscriptions","organizations_url":"https://api.github.com/users/python-telegram-bot/orgs","repos_url":"https://api.github.com/users/python-telegram-bot/repos","events_url":"https://api.github.com/users/python-telegram-bot/events{/privacy}","received_events_url":"https://api.github.com/users/python-telegram-bot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/python-telegram-bot/python-telegram-bot","description":"We have made you a wrapper you can't refuse","fork":false,"url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot","forks_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/forks","keys_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/teams","hooks_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/hooks","issue_events_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/issues/events{/number}","events_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/events","assignees_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/assignees{/user}","branches_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/branches{/branch}","tags_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/tags","blobs_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/statuses/{sha}","languages_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/languages","stargazers_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/stargazers","contributors_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/contributors","subscribers_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/subscribers","subscription_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/subscription","commits_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/contents/{+path}","compare_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/merges","archive_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/downloads","issues_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/issues{/number}","pulls_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/pulls{/number}","milestones_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/milestones{/number}","notifications_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/labels{/name}","releases_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/releases{/id}","deployments_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/deployments","created_at":"2015-07-07T15:30:39Z","updated_at":"2018-02-12T05:59:57Z","pushed_at":"2018-02-12T07:06:20Z","git_url":"git://github.com/python-telegram-bot/python-telegram-bot.git","ssh_url":"git@github.com:python-telegram-bot/python-telegram-bot.git","clone_url":"https://github.com/python-telegram-bot/python-telegram-bot.git","svn_url":"https://github.com/python-telegram-bot/python-telegram-bot","homepage":"https://python-telegram-bot.org","size":3845,"stargazers_count":4117,"watchers_count":4117,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":923,"mirror_url":null,"archived":false,"open_issues_count":45,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":923,"open_issues":45,"watchers":4117,"default_branch":"master"}},"base":{"label":"python-telegram-bot:master","ref":"master","sha":"d5c9212f2e58032534ad4ab252bbc48c7326931f","user":{"login":"python-telegram-bot","id":16178365,"avatar_url":"https://avatars2.githubusercontent.com/u/16178365?v=4","gravatar_id":"","url":"https://api.github.com/users/python-telegram-bot","html_url":"https://github.com/python-telegram-bot","followers_url":"https://api.github.com/users/python-telegram-bot/followers","following_url":"https://api.github.com/users/python-telegram-bot/following{/other_user}","gists_url":"https://api.github.com/users/python-telegram-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/python-telegram-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python-telegram-bot/subscriptions","organizations_url":"https://api.github.com/users/python-telegram-bot/orgs","repos_url":"https://api.github.com/users/python-telegram-bot/repos","events_url":"https://api.github.com/users/python-telegram-bot/events{/privacy}","received_events_url":"https://api.github.com/users/python-telegram-bot/received_events","type":"Organization","site_admin":false},"repo":{"id":38696925,"name":"python-telegram-bot","full_name":"python-telegram-bot/python-telegram-bot","owner":{"login":"python-telegram-bot","id":16178365,"avatar_url":"https://avatars2.githubusercontent.com/u/16178365?v=4","gravatar_id":"","url":"https://api.github.com/users/python-telegram-bot","html_url":"https://github.com/python-telegram-bot","followers_url":"https://api.github.com/users/python-telegram-bot/followers","following_url":"https://api.github.com/users/python-telegram-bot/following{/other_user}","gists_url":"https://api.github.com/users/python-telegram-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/python-telegram-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python-telegram-bot/subscriptions","organizations_url":"https://api.github.com/users/python-telegram-bot/orgs","repos_url":"https://api.github.com/users/python-telegram-bot/repos","events_url":"https://api.github.com/users/python-telegram-bot/events{/privacy}","received_events_url":"https://api.github.com/users/python-telegram-bot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/python-telegram-bot/python-telegram-bot","description":"We have made you a wrapper you can't refuse","fork":false,"url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot","forks_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/forks","keys_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/teams","hooks_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/hooks","issue_events_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/issues/events{/number}","events_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/events","assignees_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/assignees{/user}","branches_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/branches{/branch}","tags_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/tags","blobs_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/statuses/{sha}","languages_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/languages","stargazers_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/stargazers","contributors_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/contributors","subscribers_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/subscribers","subscription_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/subscription","commits_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/contents/{+path}","compare_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/merges","archive_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/downloads","issues_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/issues{/number}","pulls_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/pulls{/number}","milestones_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/milestones{/number}","notifications_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/labels{/name}","releases_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/releases{/id}","deployments_url":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/deployments","created_at":"2015-07-07T15:30:39Z","updated_at":"2018-02-12T05:59:57Z","pushed_at":"2018-02-12T07:06:20Z","git_url":"git://github.com/python-telegram-bot/python-telegram-bot.git","ssh_url":"git@github.com:python-telegram-bot/python-telegram-bot.git","clone_url":"https://github.com/python-telegram-bot/python-telegram-bot.git","svn_url":"https://github.com/python-telegram-bot/python-telegram-bot","homepage":"https://python-telegram-bot.org","size":3845,"stargazers_count":4117,"watchers_count":4117,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":923,"mirror_url":null,"archived":false,"open_issues_count":45,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":923,"open_issues":45,"watchers":4117,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/pulls/854"},"html":{"href":"https://github.com/python-telegram-bot/python-telegram-bot/pull/854"},"issue":{"href":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/issues/854"},"comments":{"href":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/issues/854/comments"},"review_comments":{"href":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/pulls/854/comments"},"review_comment":{"href":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/pulls/854/commits"},"statuses":{"href":"https://api.github.com/repos/python-telegram-bot/python-telegram-bot/statuses/5c3d6bd9ab62acbb9ece8b44492b14159af704db"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"tsnoam"}}