{"action":"created","comment":{"url":"https://api.github.com/repos/jmduke/corji/pulls/comments/46006424","id":46006424,"diff_hunk":"@@ -0,0 +1,48 @@\n+import csv\n+import sys\n+\n+from twilio.rest import TwilioLookupsClient, TwilioRestClient\n+\n+\n+from corji.settings import Config\n+\n+\n+client = TwilioRestClient(Config.TWILIO_ACCOUNT_SID, Config.TWILIO_AUTH_TOKEN)\n+lookup_client = TwilioLookupsClient(Config.TWILIO_ACCOUNT_SID, Config.TWILIO_AUTH_TOKEN)\n+\n+def send_message_to_number(number, message, media):\n+\treturn client.messages.create(\n+\t\tbody = message,\n+\t\tto = number,\n+\t\tmedia_url = media,\n+\t\tfrom_=Config.TWILIO_PHONE_NUMBER\n+\t\t)\n+\n+def verify_number(number):\n+\tlookup_result = lookup_client.phone_numbers.get(number)\n+\treturn lookup_result.phone_number or None\n+\n+if __name__ == \"__main__\":\n+\trecipient_list = sys.argv[1]\n+\tmessage = sys.argv[2]\n+\tmedia = sys.argv[3]\n+\ttest_number = sys.argv[4]\n+\twith open(recipient_list, newline='') as csvfile:\n+\t\tcsvreader = csv.reader(csvfile)\n+\t\tif(verify_number(test_number)):","path":"corji/scripts/send_marketing_messages.py","position":32,"original_position":32,"commit_id":"e72f8240afa00113907320beb08e633c8275354a","original_commit_id":"e72f8240afa00113907320beb08e633c8275354a","user":{"login":"jmduke","id":461046,"avatar_url":"https://avatars.githubusercontent.com/u/461046?v=3","gravatar_id":"","url":"https://api.github.com/users/jmduke","html_url":"https://github.com/jmduke","followers_url":"https://api.github.com/users/jmduke/followers","following_url":"https://api.github.com/users/jmduke/following{/other_user}","gists_url":"https://api.github.com/users/jmduke/gists{/gist_id}","starred_url":"https://api.github.com/users/jmduke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmduke/subscriptions","organizations_url":"https://api.github.com/users/jmduke/orgs","repos_url":"https://api.github.com/users/jmduke/repos","events_url":"https://api.github.com/users/jmduke/events{/privacy}","received_events_url":"https://api.github.com/users/jmduke/received_events","type":"User","site_admin":false},"body":"`if verify_number(test_number)`","created_at":"2015-11-26T20:54:09Z","updated_at":"2015-11-26T20:54:09Z","html_url":"https://github.com/jmduke/corji/pull/90#discussion_r46006424","pull_request_url":"https://api.github.com/repos/jmduke/corji/pulls/90","_links":{"self":{"href":"https://api.github.com/repos/jmduke/corji/pulls/comments/46006424"},"html":{"href":"https://github.com/jmduke/corji/pull/90#discussion_r46006424"},"pull_request":{"href":"https://api.github.com/repos/jmduke/corji/pulls/90"}}},"pull_request":{"url":"https://api.github.com/repos/jmduke/corji/pulls/90","id":51944921,"html_url":"https://github.com/jmduke/corji/pull/90","diff_url":"https://github.com/jmduke/corji/pull/90.diff","patch_url":"https://github.com/jmduke/corji/pull/90.patch","issue_url":"https://api.github.com/repos/jmduke/corji/issues/90","number":90,"state":"open","locked":false,"title":"Scripts for marketing and analysis. ","user":{"login":"shepwalker","id":6259443,"avatar_url":"https://avatars.githubusercontent.com/u/6259443?v=3","gravatar_id":"","url":"https://api.github.com/users/shepwalker","html_url":"https://github.com/shepwalker","followers_url":"https://api.github.com/users/shepwalker/followers","following_url":"https://api.github.com/users/shepwalker/following{/other_user}","gists_url":"https://api.github.com/users/shepwalker/gists{/gist_id}","starred_url":"https://api.github.com/users/shepwalker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shepwalker/subscriptions","organizations_url":"https://api.github.com/users/shepwalker/orgs","repos_url":"https://api.github.com/users/shepwalker/repos","events_url":"https://api.github.com/users/shepwalker/events{/privacy}","received_events_url":"https://api.github.com/users/shepwalker/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-26T20:47:47Z","updated_at":"2015-11-26T20:54:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c4ecb0f13c75e2c9fd4bfc534f45ab689f389ef5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jmduke/corji/pulls/90/commits","review_comments_url":"https://api.github.com/repos/jmduke/corji/pulls/90/comments","review_comment_url":"https://api.github.com/repos/jmduke/corji/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jmduke/corji/issues/90/comments","statuses_url":"https://api.github.com/repos/jmduke/corji/statuses/e72f8240afa00113907320beb08e633c8275354a","head":{"label":"shepwalker:master","ref":"master","sha":"e72f8240afa00113907320beb08e633c8275354a","user":{"login":"shepwalker","id":6259443,"avatar_url":"https://avatars.githubusercontent.com/u/6259443?v=3","gravatar_id":"","url":"https://api.github.com/users/shepwalker","html_url":"https://github.com/shepwalker","followers_url":"https://api.github.com/users/shepwalker/followers","following_url":"https://api.github.com/users/shepwalker/following{/other_user}","gists_url":"https://api.github.com/users/shepwalker/gists{/gist_id}","starred_url":"https://api.github.com/users/shepwalker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shepwalker/subscriptions","organizations_url":"https://api.github.com/users/shepwalker/orgs","repos_url":"https://api.github.com/users/shepwalker/repos","events_url":"https://api.github.com/users/shepwalker/events{/privacy}","received_events_url":"https://api.github.com/users/shepwalker/received_events","type":"User","site_admin":false},"repo":{"id":42966628,"name":"corji","full_name":"shepwalker/corji","owner":{"login":"shepwalker","id":6259443,"avatar_url":"https://avatars.githubusercontent.com/u/6259443?v=3","gravatar_id":"","url":"https://api.github.com/users/shepwalker","html_url":"https://github.com/shepwalker","followers_url":"https://api.github.com/users/shepwalker/followers","following_url":"https://api.github.com/users/shepwalker/following{/other_user}","gists_url":"https://api.github.com/users/shepwalker/gists{/gist_id}","starred_url":"https://api.github.com/users/shepwalker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shepwalker/subscriptions","organizations_url":"https://api.github.com/users/shepwalker/orgs","repos_url":"https://api.github.com/users/shepwalker/repos","events_url":"https://api.github.com/users/shepwalker/events{/privacy}","received_events_url":"https://api.github.com/users/shepwalker/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shepwalker/corji","description":"corji.","fork":true,"url":"https://api.github.com/repos/shepwalker/corji","forks_url":"https://api.github.com/repos/shepwalker/corji/forks","keys_url":"https://api.github.com/repos/shepwalker/corji/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shepwalker/corji/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shepwalker/corji/teams","hooks_url":"https://api.github.com/repos/shepwalker/corji/hooks","issue_events_url":"https://api.github.com/repos/shepwalker/corji/issues/events{/number}","events_url":"https://api.github.com/repos/shepwalker/corji/events","assignees_url":"https://api.github.com/repos/shepwalker/corji/assignees{/user}","branches_url":"https://api.github.com/repos/shepwalker/corji/branches{/branch}","tags_url":"https://api.github.com/repos/shepwalker/corji/tags","blobs_url":"https://api.github.com/repos/shepwalker/corji/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shepwalker/corji/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shepwalker/corji/git/refs{/sha}","trees_url":"https://api.github.com/repos/shepwalker/corji/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shepwalker/corji/statuses/{sha}","languages_url":"https://api.github.com/repos/shepwalker/corji/languages","stargazers_url":"https://api.github.com/repos/shepwalker/corji/stargazers","contributors_url":"https://api.github.com/repos/shepwalker/corji/contributors","subscribers_url":"https://api.github.com/repos/shepwalker/corji/subscribers","subscription_url":"https://api.github.com/repos/shepwalker/corji/subscription","commits_url":"https://api.github.com/repos/shepwalker/corji/commits{/sha}","git_commits_url":"https://api.github.com/repos/shepwalker/corji/git/commits{/sha}","comments_url":"https://api.github.com/repos/shepwalker/corji/comments{/number}","issue_comment_url":"https://api.github.com/repos/shepwalker/corji/issues/comments{/number}","contents_url":"https://api.github.com/repos/shepwalker/corji/contents/{+path}","compare_url":"https://api.github.com/repos/shepwalker/corji/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shepwalker/corji/merges","archive_url":"https://api.github.com/repos/shepwalker/corji/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shepwalker/corji/downloads","issues_url":"https://api.github.com/repos/shepwalker/corji/issues{/number}","pulls_url":"https://api.github.com/repos/shepwalker/corji/pulls{/number}","milestones_url":"https://api.github.com/repos/shepwalker/corji/milestones{/number}","notifications_url":"https://api.github.com/repos/shepwalker/corji/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shepwalker/corji/labels{/name}","releases_url":"https://api.github.com/repos/shepwalker/corji/releases{/id}","created_at":"2015-09-22T23:25:06Z","updated_at":"2015-11-12T00:24:44Z","pushed_at":"2015-11-26T20:46:11Z","git_url":"git://github.com/shepwalker/corji.git","ssh_url":"git@github.com:shepwalker/corji.git","clone_url":"https://github.com/shepwalker/corji.git","svn_url":"https://github.com/shepwalker/corji","homepage":null,"size":1459,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"jmduke:master","ref":"master","sha":"3b2e67572c542dcd36295943348eedc855ba4ace","user":{"login":"jmduke","id":461046,"avatar_url":"https://avatars.githubusercontent.com/u/461046?v=3","gravatar_id":"","url":"https://api.github.com/users/jmduke","html_url":"https://github.com/jmduke","followers_url":"https://api.github.com/users/jmduke/followers","following_url":"https://api.github.com/users/jmduke/following{/other_user}","gists_url":"https://api.github.com/users/jmduke/gists{/gist_id}","starred_url":"https://api.github.com/users/jmduke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmduke/subscriptions","organizations_url":"https://api.github.com/users/jmduke/orgs","repos_url":"https://api.github.com/users/jmduke/repos","events_url":"https://api.github.com/users/jmduke/events{/privacy}","received_events_url":"https://api.github.com/users/jmduke/received_events","type":"User","site_admin":false},"repo":{"id":42948556,"name":"corji","full_name":"jmduke/corji","owner":{"login":"jmduke","id":461046,"avatar_url":"https://avatars.githubusercontent.com/u/461046?v=3","gravatar_id":"","url":"https://api.github.com/users/jmduke","html_url":"https://github.com/jmduke","followers_url":"https://api.github.com/users/jmduke/followers","following_url":"https://api.github.com/users/jmduke/following{/other_user}","gists_url":"https://api.github.com/users/jmduke/gists{/gist_id}","starred_url":"https://api.github.com/users/jmduke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmduke/subscriptions","organizations_url":"https://api.github.com/users/jmduke/orgs","repos_url":"https://api.github.com/users/jmduke/repos","events_url":"https://api.github.com/users/jmduke/events{/privacy}","received_events_url":"https://api.github.com/users/jmduke/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jmduke/corji","description":"A distributed*, resilient*, high-availability* CDN (Corgi Delivery Network) using SMS as a transport layer.","fork":false,"url":"https://api.github.com/repos/jmduke/corji","forks_url":"https://api.github.com/repos/jmduke/corji/forks","keys_url":"https://api.github.com/repos/jmduke/corji/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jmduke/corji/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jmduke/corji/teams","hooks_url":"https://api.github.com/repos/jmduke/corji/hooks","issue_events_url":"https://api.github.com/repos/jmduke/corji/issues/events{/number}","events_url":"https://api.github.com/repos/jmduke/corji/events","assignees_url":"https://api.github.com/repos/jmduke/corji/assignees{/user}","branches_url":"https://api.github.com/repos/jmduke/corji/branches{/branch}","tags_url":"https://api.github.com/repos/jmduke/corji/tags","blobs_url":"https://api.github.com/repos/jmduke/corji/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jmduke/corji/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jmduke/corji/git/refs{/sha}","trees_url":"https://api.github.com/repos/jmduke/corji/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jmduke/corji/statuses/{sha}","languages_url":"https://api.github.com/repos/jmduke/corji/languages","stargazers_url":"https://api.github.com/repos/jmduke/corji/stargazers","contributors_url":"https://api.github.com/repos/jmduke/corji/contributors","subscribers_url":"https://api.github.com/repos/jmduke/corji/subscribers","subscription_url":"https://api.github.com/repos/jmduke/corji/subscription","commits_url":"https://api.github.com/repos/jmduke/corji/commits{/sha}","git_commits_url":"https://api.github.com/repos/jmduke/corji/git/commits{/sha}","comments_url":"https://api.github.com/repos/jmduke/corji/comments{/number}","issue_comment_url":"https://api.github.com/repos/jmduke/corji/issues/comments{/number}","contents_url":"https://api.github.com/repos/jmduke/corji/contents/{+path}","compare_url":"https://api.github.com/repos/jmduke/corji/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jmduke/corji/merges","archive_url":"https://api.github.com/repos/jmduke/corji/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jmduke/corji/downloads","issues_url":"https://api.github.com/repos/jmduke/corji/issues{/number}","pulls_url":"https://api.github.com/repos/jmduke/corji/pulls{/number}","milestones_url":"https://api.github.com/repos/jmduke/corji/milestones{/number}","notifications_url":"https://api.github.com/repos/jmduke/corji/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jmduke/corji/labels{/name}","releases_url":"https://api.github.com/repos/jmduke/corji/releases{/id}","created_at":"2015-09-22T17:11:52Z","updated_at":"2015-11-09T16:59:51Z","pushed_at":"2015-11-26T20:47:48Z","git_url":"git://github.com/jmduke/corji.git","ssh_url":"git@github.com:jmduke/corji.git","clone_url":"https://github.com/jmduke/corji.git","svn_url":"https://github.com/jmduke/corji","homepage":"http://corji.club","size":1135,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":23,"forks":2,"open_issues":23,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jmduke/corji/pulls/90"},"html":{"href":"https://github.com/jmduke/corji/pull/90"},"issue":{"href":"https://api.github.com/repos/jmduke/corji/issues/90"},"comments":{"href":"https://api.github.com/repos/jmduke/corji/issues/90/comments"},"review_comments":{"href":"https://api.github.com/repos/jmduke/corji/pulls/90/comments"},"review_comment":{"href":"https://api.github.com/repos/jmduke/corji/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jmduke/corji/pulls/90/commits"},"statuses":{"href":"https://api.github.com/repos/jmduke/corji/statuses/e72f8240afa00113907320beb08e633c8275354a"}}}}