{"action":"created","issue":{"url":"https://api.github.com/repos/mdavis1982/eve/issues/50","repository_url":"https://api.github.com/repos/mdavis1982/eve","labels_url":"https://api.github.com/repos/mdavis1982/eve/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/mdavis1982/eve/issues/50/comments","events_url":"https://api.github.com/repos/mdavis1982/eve/issues/50/events","html_url":"https://github.com/mdavis1982/eve/issues/50","id":188803397,"number":50,"title":"Add a RFC document link command","user":{"login":"byCedric","id":1203991,"avatar_url":"https://avatars.githubusercontent.com/u/1203991?v=3","gravatar_id":"","url":"https://api.github.com/users/byCedric","html_url":"https://github.com/byCedric","followers_url":"https://api.github.com/users/byCedric/followers","following_url":"https://api.github.com/users/byCedric/following{/other_user}","gists_url":"https://api.github.com/users/byCedric/gists{/gist_id}","starred_url":"https://api.github.com/users/byCedric/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/byCedric/subscriptions","organizations_url":"https://api.github.com/users/byCedric/orgs","repos_url":"https://api.github.com/users/byCedric/repos","events_url":"https://api.github.com/users/byCedric/events{/privacy}","received_events_url":"https://api.github.com/users/byCedric/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-11T16:55:16Z","updated_at":"2016-11-12T11:49:37Z","closed_at":null,"body":"### Aim\r\nA shortcut fetch a link to a provided RFC id, created by [IETF](https://ietf.org/).\r\n\r\n### Syntax\r\nExplain how to issue the command. Give code examples like:\r\n\r\n```\r\n@eve rfc 3339\r\n```\r\n\r\n### Development Requirements\r\nExplain in a list what needs to be done to get the command working:\r\n\r\n- Listen for the `command` command\r\n- Parse out the numeric value\r\n- See if the document exists and does not return a 404 status\r\n- Return a message to the user with the following information: `@user https://tools.ietf.org/html/rfc3339`\r\n\r\n### Nice To Have\r\nNow its hardcoded to return html pages only, but maybe we can implement a switch for `text` or `html`...\r\n"},"comment":{"url":"https://api.github.com/repos/mdavis1982/eve/issues/comments/260117633","html_url":"https://github.com/mdavis1982/eve/issues/50#issuecomment-260117633","issue_url":"https://api.github.com/repos/mdavis1982/eve/issues/50","id":260117633,"user":{"login":"byCedric","id":1203991,"avatar_url":"https://avatars.githubusercontent.com/u/1203991?v=3","gravatar_id":"","url":"https://api.github.com/users/byCedric","html_url":"https://github.com/byCedric","followers_url":"https://api.github.com/users/byCedric/followers","following_url":"https://api.github.com/users/byCedric/following{/other_user}","gists_url":"https://api.github.com/users/byCedric/gists{/gist_id}","starred_url":"https://api.github.com/users/byCedric/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/byCedric/subscriptions","organizations_url":"https://api.github.com/users/byCedric/orgs","repos_url":"https://api.github.com/users/byCedric/repos","events_url":"https://api.github.com/users/byCedric/events{/privacy}","received_events_url":"https://api.github.com/users/byCedric/received_events","type":"User","site_admin":false},"created_at":"2016-11-12T11:49:37Z","updated_at":"2016-11-12T11:49:37Z","body":"I can elaborate a bit on how I made this handler. The first thing I did was try and search for a RFC API or something to search for RFC's. It turns out that there is a simple search tool created by the IETF, [here](https://tools.ietf.org/html/).\r\n\r\nWith a little bit of help from the inspector I figured it made a request a page [here](https://tools.ietf.org/rfcmarkup). Using this you can find out if a RFC ID exists or if an existing URL is valid. Unfortunately it handled a redirect to the target RFC URL inconsistently. \r\n\r\n```\r\nRFC ID 3339 => https://tools.ietf.org/rfcmarkup?rfc=3339&draft=&url=\r\nRFC URL https://tools.ietf.org/html/rfc3339 => https://tools.ietf.org/html/rfc3339\r\n```\r\n\r\nSo this is not something wou could use very well, I think... Next I went back to the first search bar and try to see how they redirect the user to the good url. If you search for the form name `docfind` you will find this code.\r\n\r\n```\r\nfunction docfindRedirect() {\r\n    target = document.docfind.doc.value;\r\n    \r\n    if ( target.match(/^(https?|ftp):\\/\\/.+/) ) {\r\n        window.location = \"/rfcmarkup?url=\" + target;\r\n    } else {\r\n        window.location = \"/html/\" + target;\r\n    }\r\n\r\n    return false;\r\n}\r\n```\r\n\r\nThis actually says if an url was provided try to validate it, else just redirect to the RFC's ID URL without validating. So this is exactly how I made the handler..."}}
{"actor":{"display_login":"byCedric"}}