{"action":"created","comment":{"url":"https://api.github.com/repos/michael-lazar/rtv/pulls/comments/35871292","id":35871292,"diff_hunk":"@@ -123,7 +125,14 @@ def strip_praw_submission(sub):\n         data['subreddit'] = strip_subreddit_url(sub.permalink)\n         data['flair'] = flair\n         data['url_full'] = sub.url\n-        data['url'] = ('selfpost' if is_selfpost(sub.url) else sub.url)\n+\n+        if reddit_link.match(sub.url):\n+            stripped_url = reddit_link_no_host.search(sub.url).group()\n+            stripped_comments = reddit_link_no_host.search(sub.permalink).group()\n+            data['url'] = ('selfpost' if stripped_url == stripped_comments\n+                    else 'x-post via {}'.format(strip_subreddit_url(sub.url)) )","path":"rtv/content.py","position":28,"original_position":28,"commit_id":"763174fea6a89ef814473184c3c3a516d96a993d","original_commit_id":"763174fea6a89ef814473184c3c3a516d96a993d","user":{"login":"Brobin","id":6194619,"avatar_url":"https://avatars.githubusercontent.com/u/6194619?v=3","gravatar_id":"","url":"https://api.github.com/users/Brobin","html_url":"https://github.com/Brobin","followers_url":"https://api.github.com/users/Brobin/followers","following_url":"https://api.github.com/users/Brobin/following{/other_user}","gists_url":"https://api.github.com/users/Brobin/gists{/gist_id}","starred_url":"https://api.github.com/users/Brobin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Brobin/subscriptions","organizations_url":"https://api.github.com/users/Brobin/orgs","repos_url":"https://api.github.com/users/Brobin/repos","events_url":"https://api.github.com/users/Brobin/events{/privacy}","received_events_url":"https://api.github.com/users/Brobin/received_events","type":"User","site_admin":false},"body":"See previous comment. Would it be better to just have x-posts be `'x-post'`?","created_at":"2015-07-30T13:47:33Z","updated_at":"2015-07-30T13:47:33Z","html_url":"https://github.com/michael-lazar/rtv/pull/126#discussion_r35871292","pull_request_url":"https://api.github.com/repos/michael-lazar/rtv/pulls/126","_links":{"self":{"href":"https://api.github.com/repos/michael-lazar/rtv/pulls/comments/35871292"},"html":{"href":"https://github.com/michael-lazar/rtv/pull/126#discussion_r35871292"},"pull_request":{"href":"https://api.github.com/repos/michael-lazar/rtv/pulls/126"}}},"pull_request":{"url":"https://api.github.com/repos/michael-lazar/rtv/pulls/126","id":41218841,"html_url":"https://github.com/michael-lazar/rtv/pull/126","diff_url":"https://github.com/michael-lazar/rtv/pull/126.diff","patch_url":"https://github.com/michael-lazar/rtv/pull/126.patch","issue_url":"https://api.github.com/repos/michael-lazar/rtv/issues/126","number":126,"state":"open","locked":false,"title":"Handle internal reddit links internally, including x-posts","user":{"login":"obosob","id":1075229,"avatar_url":"https://avatars.githubusercontent.com/u/1075229?v=3","gravatar_id":"","url":"https://api.github.com/users/obosob","html_url":"https://github.com/obosob","followers_url":"https://api.github.com/users/obosob/followers","following_url":"https://api.github.com/users/obosob/following{/other_user}","gists_url":"https://api.github.com/users/obosob/gists{/gist_id}","starred_url":"https://api.github.com/users/obosob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obosob/subscriptions","organizations_url":"https://api.github.com/users/obosob/orgs","repos_url":"https://api.github.com/users/obosob/repos","events_url":"https://api.github.com/users/obosob/events{/privacy}","received_events_url":"https://api.github.com/users/obosob/received_events","type":"User","site_admin":false},"body":"Thought it made sense to handle crossposts internally too. generally improved the determination of what is a self/cross post.","created_at":"2015-07-30T10:27:00Z","updated_at":"2015-07-30T13:47:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"daae189c82f123dbb4020f615886fc689e08a198","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/michael-lazar/rtv/pulls/126/commits","review_comments_url":"https://api.github.com/repos/michael-lazar/rtv/pulls/126/comments","review_comment_url":"https://api.github.com/repos/michael-lazar/rtv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/michael-lazar/rtv/issues/126/comments","statuses_url":"https://api.github.com/repos/michael-lazar/rtv/statuses/763174fea6a89ef814473184c3c3a516d96a993d","head":{"label":"obosob:internal_links","ref":"internal_links","sha":"763174fea6a89ef814473184c3c3a516d96a993d","user":{"login":"obosob","id":1075229,"avatar_url":"https://avatars.githubusercontent.com/u/1075229?v=3","gravatar_id":"","url":"https://api.github.com/users/obosob","html_url":"https://github.com/obosob","followers_url":"https://api.github.com/users/obosob/followers","following_url":"https://api.github.com/users/obosob/following{/other_user}","gists_url":"https://api.github.com/users/obosob/gists{/gist_id}","starred_url":"https://api.github.com/users/obosob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obosob/subscriptions","organizations_url":"https://api.github.com/users/obosob/orgs","repos_url":"https://api.github.com/users/obosob/repos","events_url":"https://api.github.com/users/obosob/events{/privacy}","received_events_url":"https://api.github.com/users/obosob/received_events","type":"User","site_admin":false},"repo":{"id":39938420,"name":"rtv","full_name":"obosob/rtv","owner":{"login":"obosob","id":1075229,"avatar_url":"https://avatars.githubusercontent.com/u/1075229?v=3","gravatar_id":"","url":"https://api.github.com/users/obosob","html_url":"https://github.com/obosob","followers_url":"https://api.github.com/users/obosob/followers","following_url":"https://api.github.com/users/obosob/following{/other_user}","gists_url":"https://api.github.com/users/obosob/gists{/gist_id}","starred_url":"https://api.github.com/users/obosob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obosob/subscriptions","organizations_url":"https://api.github.com/users/obosob/orgs","repos_url":"https://api.github.com/users/obosob/repos","events_url":"https://api.github.com/users/obosob/events{/privacy}","received_events_url":"https://api.github.com/users/obosob/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/obosob/rtv","description":"Browse Reddit from your terminal","fork":true,"url":"https://api.github.com/repos/obosob/rtv","forks_url":"https://api.github.com/repos/obosob/rtv/forks","keys_url":"https://api.github.com/repos/obosob/rtv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/obosob/rtv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/obosob/rtv/teams","hooks_url":"https://api.github.com/repos/obosob/rtv/hooks","issue_events_url":"https://api.github.com/repos/obosob/rtv/issues/events{/number}","events_url":"https://api.github.com/repos/obosob/rtv/events","assignees_url":"https://api.github.com/repos/obosob/rtv/assignees{/user}","branches_url":"https://api.github.com/repos/obosob/rtv/branches{/branch}","tags_url":"https://api.github.com/repos/obosob/rtv/tags","blobs_url":"https://api.github.com/repos/obosob/rtv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/obosob/rtv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/obosob/rtv/git/refs{/sha}","trees_url":"https://api.github.com/repos/obosob/rtv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/obosob/rtv/statuses/{sha}","languages_url":"https://api.github.com/repos/obosob/rtv/languages","stargazers_url":"https://api.github.com/repos/obosob/rtv/stargazers","contributors_url":"https://api.github.com/repos/obosob/rtv/contributors","subscribers_url":"https://api.github.com/repos/obosob/rtv/subscribers","subscription_url":"https://api.github.com/repos/obosob/rtv/subscription","commits_url":"https://api.github.com/repos/obosob/rtv/commits{/sha}","git_commits_url":"https://api.github.com/repos/obosob/rtv/git/commits{/sha}","comments_url":"https://api.github.com/repos/obosob/rtv/comments{/number}","issue_comment_url":"https://api.github.com/repos/obosob/rtv/issues/comments{/number}","contents_url":"https://api.github.com/repos/obosob/rtv/contents/{+path}","compare_url":"https://api.github.com/repos/obosob/rtv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/obosob/rtv/merges","archive_url":"https://api.github.com/repos/obosob/rtv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/obosob/rtv/downloads","issues_url":"https://api.github.com/repos/obosob/rtv/issues{/number}","pulls_url":"https://api.github.com/repos/obosob/rtv/pulls{/number}","milestones_url":"https://api.github.com/repos/obosob/rtv/milestones{/number}","notifications_url":"https://api.github.com/repos/obosob/rtv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/obosob/rtv/labels{/name}","releases_url":"https://api.github.com/repos/obosob/rtv/releases{/id}","created_at":"2015-07-30T07:56:47Z","updated_at":"2015-07-30T07:56:48Z","pushed_at":"2015-07-30T11:54:24Z","git_url":"git://github.com/obosob/rtv.git","ssh_url":"git@github.com:obosob/rtv.git","clone_url":"https://github.com/obosob/rtv.git","svn_url":"https://github.com/obosob/rtv","homepage":"","size":1628,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"michael-lazar:master","ref":"master","sha":"bed4e4572fcb3e4bd35379515719ef6ffb8aaea9","user":{"login":"michael-lazar","id":5026795,"avatar_url":"https://avatars.githubusercontent.com/u/5026795?v=3","gravatar_id":"","url":"https://api.github.com/users/michael-lazar","html_url":"https://github.com/michael-lazar","followers_url":"https://api.github.com/users/michael-lazar/followers","following_url":"https://api.github.com/users/michael-lazar/following{/other_user}","gists_url":"https://api.github.com/users/michael-lazar/gists{/gist_id}","starred_url":"https://api.github.com/users/michael-lazar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael-lazar/subscriptions","organizations_url":"https://api.github.com/users/michael-lazar/orgs","repos_url":"https://api.github.com/users/michael-lazar/repos","events_url":"https://api.github.com/users/michael-lazar/events{/privacy}","received_events_url":"https://api.github.com/users/michael-lazar/received_events","type":"User","site_admin":false},"repo":{"id":30484966,"name":"rtv","full_name":"michael-lazar/rtv","owner":{"login":"michael-lazar","id":5026795,"avatar_url":"https://avatars.githubusercontent.com/u/5026795?v=3","gravatar_id":"","url":"https://api.github.com/users/michael-lazar","html_url":"https://github.com/michael-lazar","followers_url":"https://api.github.com/users/michael-lazar/followers","following_url":"https://api.github.com/users/michael-lazar/following{/other_user}","gists_url":"https://api.github.com/users/michael-lazar/gists{/gist_id}","starred_url":"https://api.github.com/users/michael-lazar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael-lazar/subscriptions","organizations_url":"https://api.github.com/users/michael-lazar/orgs","repos_url":"https://api.github.com/users/michael-lazar/repos","events_url":"https://api.github.com/users/michael-lazar/events{/privacy}","received_events_url":"https://api.github.com/users/michael-lazar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/michael-lazar/rtv","description":"Browse Reddit from your terminal","fork":false,"url":"https://api.github.com/repos/michael-lazar/rtv","forks_url":"https://api.github.com/repos/michael-lazar/rtv/forks","keys_url":"https://api.github.com/repos/michael-lazar/rtv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/michael-lazar/rtv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/michael-lazar/rtv/teams","hooks_url":"https://api.github.com/repos/michael-lazar/rtv/hooks","issue_events_url":"https://api.github.com/repos/michael-lazar/rtv/issues/events{/number}","events_url":"https://api.github.com/repos/michael-lazar/rtv/events","assignees_url":"https://api.github.com/repos/michael-lazar/rtv/assignees{/user}","branches_url":"https://api.github.com/repos/michael-lazar/rtv/branches{/branch}","tags_url":"https://api.github.com/repos/michael-lazar/rtv/tags","blobs_url":"https://api.github.com/repos/michael-lazar/rtv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/michael-lazar/rtv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/michael-lazar/rtv/git/refs{/sha}","trees_url":"https://api.github.com/repos/michael-lazar/rtv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/michael-lazar/rtv/statuses/{sha}","languages_url":"https://api.github.com/repos/michael-lazar/rtv/languages","stargazers_url":"https://api.github.com/repos/michael-lazar/rtv/stargazers","contributors_url":"https://api.github.com/repos/michael-lazar/rtv/contributors","subscribers_url":"https://api.github.com/repos/michael-lazar/rtv/subscribers","subscription_url":"https://api.github.com/repos/michael-lazar/rtv/subscription","commits_url":"https://api.github.com/repos/michael-lazar/rtv/commits{/sha}","git_commits_url":"https://api.github.com/repos/michael-lazar/rtv/git/commits{/sha}","comments_url":"https://api.github.com/repos/michael-lazar/rtv/comments{/number}","issue_comment_url":"https://api.github.com/repos/michael-lazar/rtv/issues/comments{/number}","contents_url":"https://api.github.com/repos/michael-lazar/rtv/contents/{+path}","compare_url":"https://api.github.com/repos/michael-lazar/rtv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/michael-lazar/rtv/merges","archive_url":"https://api.github.com/repos/michael-lazar/rtv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/michael-lazar/rtv/downloads","issues_url":"https://api.github.com/repos/michael-lazar/rtv/issues{/number}","pulls_url":"https://api.github.com/repos/michael-lazar/rtv/pulls{/number}","milestones_url":"https://api.github.com/repos/michael-lazar/rtv/milestones{/number}","notifications_url":"https://api.github.com/repos/michael-lazar/rtv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/michael-lazar/rtv/labels{/name}","releases_url":"https://api.github.com/repos/michael-lazar/rtv/releases{/id}","created_at":"2015-02-08T08:10:02Z","updated_at":"2015-07-28T19:13:11Z","pushed_at":"2015-07-30T11:52:56Z","git_url":"git://github.com/michael-lazar/rtv.git","ssh_url":"git@github.com:michael-lazar/rtv.git","clone_url":"https://github.com/michael-lazar/rtv.git","svn_url":"https://github.com/michael-lazar/rtv","homepage":"","size":1628,"stargazers_count":430,"watchers_count":430,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":42,"mirror_url":null,"open_issues_count":11,"forks":42,"open_issues":11,"watchers":430,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/michael-lazar/rtv/pulls/126"},"html":{"href":"https://github.com/michael-lazar/rtv/pull/126"},"issue":{"href":"https://api.github.com/repos/michael-lazar/rtv/issues/126"},"comments":{"href":"https://api.github.com/repos/michael-lazar/rtv/issues/126/comments"},"review_comments":{"href":"https://api.github.com/repos/michael-lazar/rtv/pulls/126/comments"},"review_comment":{"href":"https://api.github.com/repos/michael-lazar/rtv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/michael-lazar/rtv/pulls/126/commits"},"statuses":{"href":"https://api.github.com/repos/michael-lazar/rtv/statuses/763174fea6a89ef814473184c3c3a516d96a993d"}}}}