{"action":"created","issue":{"url":"https://api.github.com/repos/KSP-CKAN/CKAN/issues/1608","repository_url":"https://api.github.com/repos/KSP-CKAN/CKAN","labels_url":"https://api.github.com/repos/KSP-CKAN/CKAN/issues/1608/labels{/name}","comments_url":"https://api.github.com/repos/KSP-CKAN/CKAN/issues/1608/comments","events_url":"https://api.github.com/repos/KSP-CKAN/CKAN/issues/1608/events","html_url":"https://github.com/KSP-CKAN/CKAN/pull/1608","id":135904408,"number":1608,"title":"Add Curse as a $kref source","user":{"login":"airminer","id":2015460,"avatar_url":"https://avatars.githubusercontent.com/u/2015460?v=3","gravatar_id":"","url":"https://api.github.com/users/airminer","html_url":"https://github.com/airminer","followers_url":"https://api.github.com/users/airminer/followers","following_url":"https://api.github.com/users/airminer/following{/other_user}","gists_url":"https://api.github.com/users/airminer/gists{/gist_id}","starred_url":"https://api.github.com/users/airminer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/airminer/subscriptions","organizations_url":"https://api.github.com/users/airminer/orgs","repos_url":"https://api.github.com/users/airminer/repos","events_url":"https://api.github.com/users/airminer/events{/privacy}","received_events_url":"https://api.github.com/users/airminer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/KSP-CKAN/CKAN/labels/netkan","name":"netkan","color":"006b75"},{"url":"https://api.github.com/repos/KSP-CKAN/CKAN/labels/pull%20request","name":"pull request","color":"207de5"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":21,"created_at":"2016-02-23T23:54:46Z","updated_at":"2016-08-30T07:21:50Z","closed_at":"2016-08-30T07:21:50Z","pull_request":{"url":"https://api.github.com/repos/KSP-CKAN/CKAN/pulls/1608","html_url":"https://github.com/KSP-CKAN/CKAN/pull/1608","diff_url":"https://github.com/KSP-CKAN/CKAN/pull/1608.diff","patch_url":"https://github.com/KSP-CKAN/CKAN/pull/1608.patch"},"body":"I implemented a basic Curse scraper using the http://widget.mcf.li/ Json API.\r\nThe syntax for the new $kref is:\r\n\"$kref\" : \"#/ckan/curse/**curseID**\"\r\nwhere **curseID** is the number that can be seen in the curse.com urls of the mods.  \r\n\r\nFor example: the curse.com url of MechJeb is:\r\n[http://www.curse.com/ksp-mods/kerbal/**220221**-mechjeb](http://www.curse.com/ksp-mods/kerbal/220221-mechjeb)\r\nthus its $kref is:\r\n\"$kref\" : \"#/ckan/curse/**220221**\"\r\nand its API-link is\r\n[https://widget.mcf.li/project/**220221**.json](https://widget.mcf.li/project/220221.json)\r\n\r\nThe API I'm using doesn't expose all information present on the web interface (eg. Only one compatible version is reported, no source reported, etc.), and this plus information could be relatively easily extracted using the (Ms-PL licensed) [Html Agility Pack](https://www.nuget.org/packages/HtmlAgilityPack), however this plus information is generally non-essential, and may not be worth the additional effort.\r\n\r\nSome quite important information however is not reported on either interface, namely the name and version of the mods. The name is not reported in the sense that many authors change it to indicate the most recent version.\r\n\r\nI think I managed to relatively reliably isolate the name (from the title) and version (from the names of the zip files), however my approach in both cases is rather primitive.\r\n\r\nTo support the license choices available on Curse, I also added the \"AFL-3.0\", \"AGPL-3.0\", \"APSL-2.0\", \"MPL-1.0\", \"Ms-PL\" and \"Ms-RL\" OSI approved open-source licenses to the accepted licenses list.\r\n\r\nThis PR probably needs more testing and review, as I wasn't able to test it much aside from some sample .netkan files on windows in visual studio.\r\n\r\nAny and all feedback is welcome."},"comment":{"url":"https://api.github.com/repos/KSP-CKAN/CKAN/issues/comments/243354672","html_url":"https://github.com/KSP-CKAN/CKAN/pull/1608#issuecomment-243354672","issue_url":"https://api.github.com/repos/KSP-CKAN/CKAN/issues/1608","id":243354672,"user":{"login":"politas","id":2109967,"avatar_url":"https://avatars.githubusercontent.com/u/2109967?v=3","gravatar_id":"","url":"https://api.github.com/users/politas","html_url":"https://github.com/politas","followers_url":"https://api.github.com/users/politas/followers","following_url":"https://api.github.com/users/politas/following{/other_user}","gists_url":"https://api.github.com/users/politas/gists{/gist_id}","starred_url":"https://api.github.com/users/politas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/politas/subscriptions","organizations_url":"https://api.github.com/users/politas/orgs","repos_url":"https://api.github.com/users/politas/repos","events_url":"https://api.github.com/users/politas/events{/privacy}","received_events_url":"https://api.github.com/users/politas/received_events","type":"User","site_admin":false},"created_at":"2016-08-30T07:21:49Z","updated_at":"2016-08-30T07:21:49Z","body":"This has been merged, but it seems the usual matching up by GitHub didn't work. Thanks, @airminer!"}}
{"actor":{"display_login":"politas"}}