{"action":"created","comment":{"url":"https://api.github.com/repos/yagop/telegram-bot/pulls/comments/30954538","id":30954538,"diff_hunk":"@@ -0,0 +1,104 @@\n+--[[\n+* qr plugin uses:\n+* - http://goqr.me/api/doc/create-qr-code/\n+* psykomantis\n+]]\n+\n+function url_encode(str)\n+  if (str) then\n+    str = string.gsub (str, \"\\n\", \"\\r\\n\")\n+    str = string.gsub (str, \"([^%w %-%_%.%~])\",\n+        function (c) return string.format (\"%%%02X\", string.byte(c)) end)\n+    str = string.gsub (str, \" \", \"+\")\n+  end\n+  return str\n+end\n+\n+\n+function get_hex(str)\n+  if(string.match(str,\"(red)\") == \"red\") then\n+    return \"f00\"\n+  elseif(string.match(str,\"(blue)\") == \"blue\") then\n+    return \"00f\"\n+  elseif(string.match(str,\"(green)\") == \"green\") then\n+    return \"0f0\"\n+  elseif(string.match(str,\"(yellow)\") == \"yellow\") then\n+    return \"ff0\"\n+  elseif(string.match(str,\"(purple)\") == \"purple\") then\n+    return \"f0f\"\n+  elseif(string.match(str,\"(white)\") == \"white\") then\n+    return \"fff\"\n+  elseif(string.match(str,\"(black)\") == \"black\") then\n+    return \"000\"\n+  elseif(string.match(str,\"(gray)\") == \"gray\") then\n+    return \"ccc\"\n+  end\n+\n+  return str\n+end\n+\n+\n+\n+do\n+\n+local function qr(msg, query)\n+\n+  local receiver = get_receiver(msg)\n+\n+  local http = require(\"socket.http\")\n+  local url = \"http://api.qrserver.com/v1/create-qr-code/?\" .. query .. \"&size=600x600\"  --fixed size otherways it's low detailed\n+  local response, code, headers = http.request(url)\n+\n+  if code ~= 200 then\n+    return \"Oops! Error: \" .. code\n+  end\n+\n+  if #response > 0 then\n+\t   send_photo_from_url(receiver, url)\n+\treturn","path":"plugins/qr.lua","position":58,"original_position":58,"commit_id":"f092a0f45b1317b3be13377ae7f04a79551d5d0e","original_commit_id":"f092a0f45b1317b3be13377ae7f04a79551d5d0e","user":{"login":"Walkman100","id":5454764,"avatar_url":"https://avatars.githubusercontent.com/u/5454764?v=3","gravatar_id":"","url":"https://api.github.com/users/Walkman100","html_url":"https://github.com/Walkman100","followers_url":"https://api.github.com/users/Walkman100/followers","following_url":"https://api.github.com/users/Walkman100/following{/other_user}","gists_url":"https://api.github.com/users/Walkman100/gists{/gist_id}","starred_url":"https://api.github.com/users/Walkman100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Walkman100/subscriptions","organizations_url":"https://api.github.com/users/Walkman100/orgs","repos_url":"https://api.github.com/users/Walkman100/repos","events_url":"https://api.github.com/users/Walkman100/events{/privacy}","received_events_url":"https://api.github.com/users/Walkman100/received_events","type":"User","site_admin":false},"body":"Indentation screw up :worried:","created_at":"2015-05-24T18:25:13Z","updated_at":"2015-05-24T18:25:13Z","html_url":"https://github.com/yagop/telegram-bot/pull/189#discussion_r30954538","pull_request_url":"https://api.github.com/repos/yagop/telegram-bot/pulls/189","_links":{"self":{"href":"https://api.github.com/repos/yagop/telegram-bot/pulls/comments/30954538"},"html":{"href":"https://github.com/yagop/telegram-bot/pull/189#discussion_r30954538"},"pull_request":{"href":"https://api.github.com/repos/yagop/telegram-bot/pulls/189"}}},"pull_request":{"url":"https://api.github.com/repos/yagop/telegram-bot/pulls/189","id":36096647,"html_url":"https://github.com/yagop/telegram-bot/pull/189","diff_url":"https://github.com/yagop/telegram-bot/pull/189.diff","patch_url":"https://github.com/yagop/telegram-bot/pull/189.patch","issue_url":"https://api.github.com/repos/yagop/telegram-bot/issues/189","number":189,"state":"open","locked":false,"title":"Qr code plugin","user":{"login":"psykomantis","id":5663725,"avatar_url":"https://avatars.githubusercontent.com/u/5663725?v=3","gravatar_id":"","url":"https://api.github.com/users/psykomantis","html_url":"https://github.com/psykomantis","followers_url":"https://api.github.com/users/psykomantis/followers","following_url":"https://api.github.com/users/psykomantis/following{/other_user}","gists_url":"https://api.github.com/users/psykomantis/gists{/gist_id}","starred_url":"https://api.github.com/users/psykomantis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psykomantis/subscriptions","organizations_url":"https://api.github.com/users/psykomantis/orgs","repos_url":"https://api.github.com/users/psykomantis/repos","events_url":"https://api.github.com/users/psykomantis/events{/privacy}","received_events_url":"https://api.github.com/users/psykomantis/received_events","type":"User","site_admin":false},"body":"Qr plugin, given a text it returns a qr code (with colors if you want)","created_at":"2015-05-24T01:35:59Z","updated_at":"2015-05-24T18:25:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7efdb5682c235a3805ad862bd1a86861e9a90c88","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/yagop/telegram-bot/pulls/189/commits","review_comments_url":"https://api.github.com/repos/yagop/telegram-bot/pulls/189/comments","review_comment_url":"https://api.github.com/repos/yagop/telegram-bot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yagop/telegram-bot/issues/189/comments","statuses_url":"https://api.github.com/repos/yagop/telegram-bot/statuses/f092a0f45b1317b3be13377ae7f04a79551d5d0e","head":{"label":"psykomantis:master","ref":"master","sha":"f092a0f45b1317b3be13377ae7f04a79551d5d0e","user":{"login":"psykomantis","id":5663725,"avatar_url":"https://avatars.githubusercontent.com/u/5663725?v=3","gravatar_id":"","url":"https://api.github.com/users/psykomantis","html_url":"https://github.com/psykomantis","followers_url":"https://api.github.com/users/psykomantis/followers","following_url":"https://api.github.com/users/psykomantis/following{/other_user}","gists_url":"https://api.github.com/users/psykomantis/gists{/gist_id}","starred_url":"https://api.github.com/users/psykomantis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psykomantis/subscriptions","organizations_url":"https://api.github.com/users/psykomantis/orgs","repos_url":"https://api.github.com/users/psykomantis/repos","events_url":"https://api.github.com/users/psykomantis/events{/privacy}","received_events_url":"https://api.github.com/users/psykomantis/received_events","type":"User","site_admin":false},"repo":{"id":36150447,"name":"telegram-bot","full_name":"psykomantis/telegram-bot","owner":{"login":"psykomantis","id":5663725,"avatar_url":"https://avatars.githubusercontent.com/u/5663725?v=3","gravatar_id":"","url":"https://api.github.com/users/psykomantis","html_url":"https://github.com/psykomantis","followers_url":"https://api.github.com/users/psykomantis/followers","following_url":"https://api.github.com/users/psykomantis/following{/other_user}","gists_url":"https://api.github.com/users/psykomantis/gists{/gist_id}","starred_url":"https://api.github.com/users/psykomantis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psykomantis/subscriptions","organizations_url":"https://api.github.com/users/psykomantis/orgs","repos_url":"https://api.github.com/users/psykomantis/repos","events_url":"https://api.github.com/users/psykomantis/events{/privacy}","received_events_url":"https://api.github.com/users/psykomantis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/psykomantis/telegram-bot","description":"A Telegram Bot based on plugins","fork":true,"url":"https://api.github.com/repos/psykomantis/telegram-bot","forks_url":"https://api.github.com/repos/psykomantis/telegram-bot/forks","keys_url":"https://api.github.com/repos/psykomantis/telegram-bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/psykomantis/telegram-bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/psykomantis/telegram-bot/teams","hooks_url":"https://api.github.com/repos/psykomantis/telegram-bot/hooks","issue_events_url":"https://api.github.com/repos/psykomantis/telegram-bot/issues/events{/number}","events_url":"https://api.github.com/repos/psykomantis/telegram-bot/events","assignees_url":"https://api.github.com/repos/psykomantis/telegram-bot/assignees{/user}","branches_url":"https://api.github.com/repos/psykomantis/telegram-bot/branches{/branch}","tags_url":"https://api.github.com/repos/psykomantis/telegram-bot/tags","blobs_url":"https://api.github.com/repos/psykomantis/telegram-bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/psykomantis/telegram-bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/psykomantis/telegram-bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/psykomantis/telegram-bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/psykomantis/telegram-bot/statuses/{sha}","languages_url":"https://api.github.com/repos/psykomantis/telegram-bot/languages","stargazers_url":"https://api.github.com/repos/psykomantis/telegram-bot/stargazers","contributors_url":"https://api.github.com/repos/psykomantis/telegram-bot/contributors","subscribers_url":"https://api.github.com/repos/psykomantis/telegram-bot/subscribers","subscription_url":"https://api.github.com/repos/psykomantis/telegram-bot/subscription","commits_url":"https://api.github.com/repos/psykomantis/telegram-bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/psykomantis/telegram-bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/psykomantis/telegram-bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/psykomantis/telegram-bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/psykomantis/telegram-bot/contents/{+path}","compare_url":"https://api.github.com/repos/psykomantis/telegram-bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/psykomantis/telegram-bot/merges","archive_url":"https://api.github.com/repos/psykomantis/telegram-bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/psykomantis/telegram-bot/downloads","issues_url":"https://api.github.com/repos/psykomantis/telegram-bot/issues{/number}","pulls_url":"https://api.github.com/repos/psykomantis/telegram-bot/pulls{/number}","milestones_url":"https://api.github.com/repos/psykomantis/telegram-bot/milestones{/number}","notifications_url":"https://api.github.com/repos/psykomantis/telegram-bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/psykomantis/telegram-bot/labels{/name}","releases_url":"https://api.github.com/repos/psykomantis/telegram-bot/releases{/id}","created_at":"2015-05-24T01:28:33Z","updated_at":"2015-05-24T01:28:34Z","pushed_at":"2015-05-24T01:34:38Z","git_url":"git://github.com/psykomantis/telegram-bot.git","ssh_url":"git@github.com:psykomantis/telegram-bot.git","clone_url":"https://github.com/psykomantis/telegram-bot.git","svn_url":"https://github.com/psykomantis/telegram-bot","homepage":"","size":4103,"stargazers_count":0,"watchers_count":0,"language":"Lua","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":"yagop:master","ref":"master","sha":"38859daa2aca056a46eed353bf9470ca3588fd69","user":{"login":"yagop","id":5002453,"avatar_url":"https://avatars.githubusercontent.com/u/5002453?v=3","gravatar_id":"","url":"https://api.github.com/users/yagop","html_url":"https://github.com/yagop","followers_url":"https://api.github.com/users/yagop/followers","following_url":"https://api.github.com/users/yagop/following{/other_user}","gists_url":"https://api.github.com/users/yagop/gists{/gist_id}","starred_url":"https://api.github.com/users/yagop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yagop/subscriptions","organizations_url":"https://api.github.com/users/yagop/orgs","repos_url":"https://api.github.com/users/yagop/repos","events_url":"https://api.github.com/users/yagop/events{/privacy}","received_events_url":"https://api.github.com/users/yagop/received_events","type":"User","site_admin":false},"repo":{"id":21347647,"name":"telegram-bot","full_name":"yagop/telegram-bot","owner":{"login":"yagop","id":5002453,"avatar_url":"https://avatars.githubusercontent.com/u/5002453?v=3","gravatar_id":"","url":"https://api.github.com/users/yagop","html_url":"https://github.com/yagop","followers_url":"https://api.github.com/users/yagop/followers","following_url":"https://api.github.com/users/yagop/following{/other_user}","gists_url":"https://api.github.com/users/yagop/gists{/gist_id}","starred_url":"https://api.github.com/users/yagop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yagop/subscriptions","organizations_url":"https://api.github.com/users/yagop/orgs","repos_url":"https://api.github.com/users/yagop/repos","events_url":"https://api.github.com/users/yagop/events{/privacy}","received_events_url":"https://api.github.com/users/yagop/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yagop/telegram-bot","description":"A Telegram Bot based on plugins","fork":false,"url":"https://api.github.com/repos/yagop/telegram-bot","forks_url":"https://api.github.com/repos/yagop/telegram-bot/forks","keys_url":"https://api.github.com/repos/yagop/telegram-bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yagop/telegram-bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yagop/telegram-bot/teams","hooks_url":"https://api.github.com/repos/yagop/telegram-bot/hooks","issue_events_url":"https://api.github.com/repos/yagop/telegram-bot/issues/events{/number}","events_url":"https://api.github.com/repos/yagop/telegram-bot/events","assignees_url":"https://api.github.com/repos/yagop/telegram-bot/assignees{/user}","branches_url":"https://api.github.com/repos/yagop/telegram-bot/branches{/branch}","tags_url":"https://api.github.com/repos/yagop/telegram-bot/tags","blobs_url":"https://api.github.com/repos/yagop/telegram-bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yagop/telegram-bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yagop/telegram-bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/yagop/telegram-bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yagop/telegram-bot/statuses/{sha}","languages_url":"https://api.github.com/repos/yagop/telegram-bot/languages","stargazers_url":"https://api.github.com/repos/yagop/telegram-bot/stargazers","contributors_url":"https://api.github.com/repos/yagop/telegram-bot/contributors","subscribers_url":"https://api.github.com/repos/yagop/telegram-bot/subscribers","subscription_url":"https://api.github.com/repos/yagop/telegram-bot/subscription","commits_url":"https://api.github.com/repos/yagop/telegram-bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/yagop/telegram-bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/yagop/telegram-bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/yagop/telegram-bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/yagop/telegram-bot/contents/{+path}","compare_url":"https://api.github.com/repos/yagop/telegram-bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yagop/telegram-bot/merges","archive_url":"https://api.github.com/repos/yagop/telegram-bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yagop/telegram-bot/downloads","issues_url":"https://api.github.com/repos/yagop/telegram-bot/issues{/number}","pulls_url":"https://api.github.com/repos/yagop/telegram-bot/pulls{/number}","milestones_url":"https://api.github.com/repos/yagop/telegram-bot/milestones{/number}","notifications_url":"https://api.github.com/repos/yagop/telegram-bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yagop/telegram-bot/labels{/name}","releases_url":"https://api.github.com/repos/yagop/telegram-bot/releases{/id}","created_at":"2014-06-30T10:34:41Z","updated_at":"2015-05-24T17:37:31Z","pushed_at":"2015-05-24T18:22:44Z","git_url":"git://github.com/yagop/telegram-bot.git","ssh_url":"git@github.com:yagop/telegram-bot.git","clone_url":"https://github.com/yagop/telegram-bot.git","svn_url":"https://github.com/yagop/telegram-bot","homepage":"","size":4103,"stargazers_count":257,"watchers_count":257,"language":"Lua","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":148,"mirror_url":null,"open_issues_count":32,"forks":148,"open_issues":32,"watchers":257,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yagop/telegram-bot/pulls/189"},"html":{"href":"https://github.com/yagop/telegram-bot/pull/189"},"issue":{"href":"https://api.github.com/repos/yagop/telegram-bot/issues/189"},"comments":{"href":"https://api.github.com/repos/yagop/telegram-bot/issues/189/comments"},"review_comments":{"href":"https://api.github.com/repos/yagop/telegram-bot/pulls/189/comments"},"review_comment":{"href":"https://api.github.com/repos/yagop/telegram-bot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yagop/telegram-bot/pulls/189/commits"},"statuses":{"href":"https://api.github.com/repos/yagop/telegram-bot/statuses/f092a0f45b1317b3be13377ae7f04a79551d5d0e"}}}}