{"action":"created","comment":{"url":"https://api.github.com/repos/PressLabs/presswise-ng/pulls/comments/35325453","id":35325453,"diff_hunk":"@@ -1,8 +1,45 @@\n+import socket\n+\n+import whois,requests\n+\n+from tld import get_tld\n+from django.http import JsonResponse,HttpResponse\n from django.shortcuts import render,render_to_response\n from django.template.context import RequestContext\n \n+from src.criteria.models import *\n+from src.dashboard.models import *\n \n def home(request):\n    context = RequestContext(request)\n    return render_to_response('dashboard/home.html',\n                              context_instance=context)\n+\n+def req(request):\n+   if request.method == 'GET':\n+     if request.GET['action'] == 'get_website_data':\n+\n+       #call api\n+       apikey = '59eeb45d308fdf84a06b14e28a0188d3'\n+       rank = requests.get('https://apps.compete.com/sites/'+get_tld(request.GET['url'])+'/trended/rank/?apikey='+apikey).json()['data']['trends']['rank'][0]['value']\n+       website_info = whois.whois(request.GET['url'])\n+       website_info['rank'] = rank\n+       \n+       provider_id = 0\n+       #check for provider\n+       for provider in Provider.objects.all():\n+         if provider.header_criteria.compute(request.GET['url']) or provider.ip_criteria.compute(request.GET['url']) or provider.source_criteria.compute(request.GET['url']):\n+           provider_id = provider.id\n+           break\n+       \n+       website_info['provider'] = provider_id\n+       return JsonResponse(website_info,safe=False)\n+\n+   else:\n+     if request.POST['action'] == 'update_providers':","path":"src/dashboard/views.py","position":39,"original_position":39,"commit_id":"17a7a415610c3444e6a6eff7f558b944c497a49e","original_commit_id":"17a7a415610c3444e6a6eff7f558b944c497a49e","user":{"login":"vtemian","id":639771,"avatar_url":"https://avatars.githubusercontent.com/u/639771?v=3","gravatar_id":"","url":"https://api.github.com/users/vtemian","html_url":"https://github.com/vtemian","followers_url":"https://api.github.com/users/vtemian/followers","following_url":"https://api.github.com/users/vtemian/following{/other_user}","gists_url":"https://api.github.com/users/vtemian/gists{/gist_id}","starred_url":"https://api.github.com/users/vtemian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vtemian/subscriptions","organizations_url":"https://api.github.com/users/vtemian/orgs","repos_url":"https://api.github.com/users/vtemian/repos","events_url":"https://api.github.com/users/vtemian/events{/privacy}","received_events_url":"https://api.github.com/users/vtemian/received_events","type":"User","site_admin":false},"body":"Use another endpoint for this.","created_at":"2015-07-23T14:17:58Z","updated_at":"2015-07-23T14:17:58Z","html_url":"https://github.com/PressLabs/presswise-ng/pull/55#discussion_r35325453","pull_request_url":"https://api.github.com/repos/PressLabs/presswise-ng/pulls/55","_links":{"self":{"href":"https://api.github.com/repos/PressLabs/presswise-ng/pulls/comments/35325453"},"html":{"href":"https://github.com/PressLabs/presswise-ng/pull/55#discussion_r35325453"},"pull_request":{"href":"https://api.github.com/repos/PressLabs/presswise-ng/pulls/55"}}},"pull_request":{"url":"https://api.github.com/repos/PressLabs/presswise-ng/pulls/55","id":40647966,"html_url":"https://github.com/PressLabs/presswise-ng/pull/55","diff_url":"https://github.com/PressLabs/presswise-ng/pull/55.diff","patch_url":"https://github.com/PressLabs/presswise-ng/pull/55.patch","issue_url":"https://api.github.com/repos/PressLabs/presswise-ng/issues/55","number":55,"state":"open","locked":false,"title":"45 website admin","user":{"login":"Cozloschi","id":8299041,"avatar_url":"https://avatars.githubusercontent.com/u/8299041?v=3","gravatar_id":"","url":"https://api.github.com/users/Cozloschi","html_url":"https://github.com/Cozloschi","followers_url":"https://api.github.com/users/Cozloschi/followers","following_url":"https://api.github.com/users/Cozloschi/following{/other_user}","gists_url":"https://api.github.com/users/Cozloschi/gists{/gist_id}","starred_url":"https://api.github.com/users/Cozloschi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cozloschi/subscriptions","organizations_url":"https://api.github.com/users/Cozloschi/orgs","repos_url":"https://api.github.com/users/Cozloschi/repos","events_url":"https://api.github.com/users/Cozloschi/events{/privacy}","received_events_url":"https://api.github.com/users/Cozloschi/received_events","type":"User","site_admin":false},"body":"@vtemian ","created_at":"2015-07-23T08:29:47Z","updated_at":"2015-07-23T14:17:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3f7eb2476cc8968f5ad42c5004a0591c89dc03d4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/PressLabs/presswise-ng/pulls/55/commits","review_comments_url":"https://api.github.com/repos/PressLabs/presswise-ng/pulls/55/comments","review_comment_url":"https://api.github.com/repos/PressLabs/presswise-ng/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PressLabs/presswise-ng/issues/55/comments","statuses_url":"https://api.github.com/repos/PressLabs/presswise-ng/statuses/17a7a415610c3444e6a6eff7f558b944c497a49e","head":{"label":"PressLabs:45-website-admin","ref":"45-website-admin","sha":"17a7a415610c3444e6a6eff7f558b944c497a49e","user":{"login":"PressLabs","id":1033395,"avatar_url":"https://avatars.githubusercontent.com/u/1033395?v=3","gravatar_id":"","url":"https://api.github.com/users/PressLabs","html_url":"https://github.com/PressLabs","followers_url":"https://api.github.com/users/PressLabs/followers","following_url":"https://api.github.com/users/PressLabs/following{/other_user}","gists_url":"https://api.github.com/users/PressLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/PressLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PressLabs/subscriptions","organizations_url":"https://api.github.com/users/PressLabs/orgs","repos_url":"https://api.github.com/users/PressLabs/repos","events_url":"https://api.github.com/users/PressLabs/events{/privacy}","received_events_url":"https://api.github.com/users/PressLabs/received_events","type":"Organization","site_admin":false},"repo":{"id":38364073,"name":"presswise-ng","full_name":"PressLabs/presswise-ng","owner":{"login":"PressLabs","id":1033395,"avatar_url":"https://avatars.githubusercontent.com/u/1033395?v=3","gravatar_id":"","url":"https://api.github.com/users/PressLabs","html_url":"https://github.com/PressLabs","followers_url":"https://api.github.com/users/PressLabs/followers","following_url":"https://api.github.com/users/PressLabs/following{/other_user}","gists_url":"https://api.github.com/users/PressLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/PressLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PressLabs/subscriptions","organizations_url":"https://api.github.com/users/PressLabs/orgs","repos_url":"https://api.github.com/users/PressLabs/repos","events_url":"https://api.github.com/users/PressLabs/events{/privacy}","received_events_url":"https://api.github.com/users/PressLabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PressLabs/presswise-ng","description":"The next generation of PressWise","fork":false,"url":"https://api.github.com/repos/PressLabs/presswise-ng","forks_url":"https://api.github.com/repos/PressLabs/presswise-ng/forks","keys_url":"https://api.github.com/repos/PressLabs/presswise-ng/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PressLabs/presswise-ng/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PressLabs/presswise-ng/teams","hooks_url":"https://api.github.com/repos/PressLabs/presswise-ng/hooks","issue_events_url":"https://api.github.com/repos/PressLabs/presswise-ng/issues/events{/number}","events_url":"https://api.github.com/repos/PressLabs/presswise-ng/events","assignees_url":"https://api.github.com/repos/PressLabs/presswise-ng/assignees{/user}","branches_url":"https://api.github.com/repos/PressLabs/presswise-ng/branches{/branch}","tags_url":"https://api.github.com/repos/PressLabs/presswise-ng/tags","blobs_url":"https://api.github.com/repos/PressLabs/presswise-ng/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PressLabs/presswise-ng/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PressLabs/presswise-ng/git/refs{/sha}","trees_url":"https://api.github.com/repos/PressLabs/presswise-ng/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PressLabs/presswise-ng/statuses/{sha}","languages_url":"https://api.github.com/repos/PressLabs/presswise-ng/languages","stargazers_url":"https://api.github.com/repos/PressLabs/presswise-ng/stargazers","contributors_url":"https://api.github.com/repos/PressLabs/presswise-ng/contributors","subscribers_url":"https://api.github.com/repos/PressLabs/presswise-ng/subscribers","subscription_url":"https://api.github.com/repos/PressLabs/presswise-ng/subscription","commits_url":"https://api.github.com/repos/PressLabs/presswise-ng/commits{/sha}","git_commits_url":"https://api.github.com/repos/PressLabs/presswise-ng/git/commits{/sha}","comments_url":"https://api.github.com/repos/PressLabs/presswise-ng/comments{/number}","issue_comment_url":"https://api.github.com/repos/PressLabs/presswise-ng/issues/comments{/number}","contents_url":"https://api.github.com/repos/PressLabs/presswise-ng/contents/{+path}","compare_url":"https://api.github.com/repos/PressLabs/presswise-ng/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PressLabs/presswise-ng/merges","archive_url":"https://api.github.com/repos/PressLabs/presswise-ng/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PressLabs/presswise-ng/downloads","issues_url":"https://api.github.com/repos/PressLabs/presswise-ng/issues{/number}","pulls_url":"https://api.github.com/repos/PressLabs/presswise-ng/pulls{/number}","milestones_url":"https://api.github.com/repos/PressLabs/presswise-ng/milestones{/number}","notifications_url":"https://api.github.com/repos/PressLabs/presswise-ng/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PressLabs/presswise-ng/labels{/name}","releases_url":"https://api.github.com/repos/PressLabs/presswise-ng/releases{/id}","created_at":"2015-07-01T10:05:16Z","updated_at":"2015-07-22T16:10:48Z","pushed_at":"2015-07-23T12:12:44Z","git_url":"git://github.com/PressLabs/presswise-ng.git","ssh_url":"git@github.com:PressLabs/presswise-ng.git","clone_url":"https://github.com/PressLabs/presswise-ng.git","svn_url":"https://github.com/PressLabs/presswise-ng","homepage":null,"size":544,"stargazers_count":1,"watchers_count":1,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":21,"forks":0,"open_issues":21,"watchers":1,"default_branch":"master"}},"base":{"label":"PressLabs:master","ref":"master","sha":"cde73717bc7e26c9e755f3c8307cf44d92e231bb","user":{"login":"PressLabs","id":1033395,"avatar_url":"https://avatars.githubusercontent.com/u/1033395?v=3","gravatar_id":"","url":"https://api.github.com/users/PressLabs","html_url":"https://github.com/PressLabs","followers_url":"https://api.github.com/users/PressLabs/followers","following_url":"https://api.github.com/users/PressLabs/following{/other_user}","gists_url":"https://api.github.com/users/PressLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/PressLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PressLabs/subscriptions","organizations_url":"https://api.github.com/users/PressLabs/orgs","repos_url":"https://api.github.com/users/PressLabs/repos","events_url":"https://api.github.com/users/PressLabs/events{/privacy}","received_events_url":"https://api.github.com/users/PressLabs/received_events","type":"Organization","site_admin":false},"repo":{"id":38364073,"name":"presswise-ng","full_name":"PressLabs/presswise-ng","owner":{"login":"PressLabs","id":1033395,"avatar_url":"https://avatars.githubusercontent.com/u/1033395?v=3","gravatar_id":"","url":"https://api.github.com/users/PressLabs","html_url":"https://github.com/PressLabs","followers_url":"https://api.github.com/users/PressLabs/followers","following_url":"https://api.github.com/users/PressLabs/following{/other_user}","gists_url":"https://api.github.com/users/PressLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/PressLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PressLabs/subscriptions","organizations_url":"https://api.github.com/users/PressLabs/orgs","repos_url":"https://api.github.com/users/PressLabs/repos","events_url":"https://api.github.com/users/PressLabs/events{/privacy}","received_events_url":"https://api.github.com/users/PressLabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PressLabs/presswise-ng","description":"The next generation of PressWise","fork":false,"url":"https://api.github.com/repos/PressLabs/presswise-ng","forks_url":"https://api.github.com/repos/PressLabs/presswise-ng/forks","keys_url":"https://api.github.com/repos/PressLabs/presswise-ng/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PressLabs/presswise-ng/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PressLabs/presswise-ng/teams","hooks_url":"https://api.github.com/repos/PressLabs/presswise-ng/hooks","issue_events_url":"https://api.github.com/repos/PressLabs/presswise-ng/issues/events{/number}","events_url":"https://api.github.com/repos/PressLabs/presswise-ng/events","assignees_url":"https://api.github.com/repos/PressLabs/presswise-ng/assignees{/user}","branches_url":"https://api.github.com/repos/PressLabs/presswise-ng/branches{/branch}","tags_url":"https://api.github.com/repos/PressLabs/presswise-ng/tags","blobs_url":"https://api.github.com/repos/PressLabs/presswise-ng/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PressLabs/presswise-ng/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PressLabs/presswise-ng/git/refs{/sha}","trees_url":"https://api.github.com/repos/PressLabs/presswise-ng/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PressLabs/presswise-ng/statuses/{sha}","languages_url":"https://api.github.com/repos/PressLabs/presswise-ng/languages","stargazers_url":"https://api.github.com/repos/PressLabs/presswise-ng/stargazers","contributors_url":"https://api.github.com/repos/PressLabs/presswise-ng/contributors","subscribers_url":"https://api.github.com/repos/PressLabs/presswise-ng/subscribers","subscription_url":"https://api.github.com/repos/PressLabs/presswise-ng/subscription","commits_url":"https://api.github.com/repos/PressLabs/presswise-ng/commits{/sha}","git_commits_url":"https://api.github.com/repos/PressLabs/presswise-ng/git/commits{/sha}","comments_url":"https://api.github.com/repos/PressLabs/presswise-ng/comments{/number}","issue_comment_url":"https://api.github.com/repos/PressLabs/presswise-ng/issues/comments{/number}","contents_url":"https://api.github.com/repos/PressLabs/presswise-ng/contents/{+path}","compare_url":"https://api.github.com/repos/PressLabs/presswise-ng/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PressLabs/presswise-ng/merges","archive_url":"https://api.github.com/repos/PressLabs/presswise-ng/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PressLabs/presswise-ng/downloads","issues_url":"https://api.github.com/repos/PressLabs/presswise-ng/issues{/number}","pulls_url":"https://api.github.com/repos/PressLabs/presswise-ng/pulls{/number}","milestones_url":"https://api.github.com/repos/PressLabs/presswise-ng/milestones{/number}","notifications_url":"https://api.github.com/repos/PressLabs/presswise-ng/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PressLabs/presswise-ng/labels{/name}","releases_url":"https://api.github.com/repos/PressLabs/presswise-ng/releases{/id}","created_at":"2015-07-01T10:05:16Z","updated_at":"2015-07-22T16:10:48Z","pushed_at":"2015-07-23T12:12:44Z","git_url":"git://github.com/PressLabs/presswise-ng.git","ssh_url":"git@github.com:PressLabs/presswise-ng.git","clone_url":"https://github.com/PressLabs/presswise-ng.git","svn_url":"https://github.com/PressLabs/presswise-ng","homepage":null,"size":544,"stargazers_count":1,"watchers_count":1,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":21,"forks":0,"open_issues":21,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PressLabs/presswise-ng/pulls/55"},"html":{"href":"https://github.com/PressLabs/presswise-ng/pull/55"},"issue":{"href":"https://api.github.com/repos/PressLabs/presswise-ng/issues/55"},"comments":{"href":"https://api.github.com/repos/PressLabs/presswise-ng/issues/55/comments"},"review_comments":{"href":"https://api.github.com/repos/PressLabs/presswise-ng/pulls/55/comments"},"review_comment":{"href":"https://api.github.com/repos/PressLabs/presswise-ng/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PressLabs/presswise-ng/pulls/55/commits"},"statuses":{"href":"https://api.github.com/repos/PressLabs/presswise-ng/statuses/17a7a415610c3444e6a6eff7f558b944c497a49e"}}}}