{"action":"created","issue":{"url":"https://api.github.com/repos/tikalk/commandcar/issues/9","labels_url":"https://api.github.com/repos/tikalk/commandcar/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/tikalk/commandcar/issues/9/comments","events_url":"https://api.github.com/repos/tikalk/commandcar/issues/9/events","html_url":"https://github.com/tikalk/commandcar/issues/9","id":119540971,"number":9,"title":"SyntaxError: Unexpected token <","user":{"login":"mihaiolteanu","id":8273519,"avatar_url":"https://avatars.githubusercontent.com/u/8273519?v=3","gravatar_id":"","url":"https://api.github.com/users/mihaiolteanu","html_url":"https://github.com/mihaiolteanu","followers_url":"https://api.github.com/users/mihaiolteanu/followers","following_url":"https://api.github.com/users/mihaiolteanu/following{/other_user}","gists_url":"https://api.github.com/users/mihaiolteanu/gists{/gist_id}","starred_url":"https://api.github.com/users/mihaiolteanu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihaiolteanu/subscriptions","organizations_url":"https://api.github.com/users/mihaiolteanu/orgs","repos_url":"https://api.github.com/users/mihaiolteanu/repos","events_url":"https://api.github.com/users/mihaiolteanu/events{/privacy}","received_events_url":"https://api.github.com/users/mihaiolteanu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-30T17:32:05Z","updated_at":"2015-11-30T20:52:55Z","closed_at":null,"body":"I'm trying to create an API for [last.fm](http://www.last.fm/api/intro), but I'm getting this error:\r\n\r\n```\r\nSyntaxError: Unexpected token <\r\n    at Object.parse (native)\r\n    at Request._callback (/usr/local/lib/node_modules/commandcar/main.js:346:21)\r\n    at Request.self.callback (/usr/local/lib/node_modules/commandcar/node_modules/request/request.js:198:22)\r\n    at Request.EventEmitter.emit (events.js:98:17)\r\n    at Request.<anonymous> (/usr/local/lib/node_modules/commandcar/node_modules/request/request.js:1035:10)\r\n    at Request.EventEmitter.emit (events.js:117:20)\r\n    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/commandcar/node_modules/request/request.js:962:12)\r\n    at IncomingMessage.EventEmitter.emit (events.js:117:20)\r\n    at _stream_readable.js:920:16\r\n    at process._tickCallback (node.js:415:13)\r\n```\r\nwhen I call `commandcar` thus:\r\n`commandcar lastfm.artist_getSimilar --artist airbag -k myapikey`\r\nafter a\r\n`sudo commandcar load --location ~/projects/commandcar/lastfm`\r\n\r\nThe `lastfm` folder contains the `api.json` file:\r\n```\r\n{\r\n    \"protocol\": \"https\",\r\n    \"hostname\": \"ws.audioscrobbler.com/2.0\",\r\n    \"use_options\": [\r\n        {\r\n            \"short\": \"k\",\r\n            \"long\": \"api_key\",\r\n            \"def\": \"api_key\",\r\n            \"desc\": \"api_key\",\r\n        }\r\n    ]\r\n}\r\n```\r\nand a `commands` folder inside it with the `artist_getSimilar.json` file:\r\n```\r\n{\r\n    \"path_template\": \"/?method=artist.getSimilar&artist={artist}&limit=5&api_key={api_key}\",\r\n    \"ret\": \"name\",\r\n    \"options\": [\r\n        {\r\n            \"short\": \"a\",\r\n            \"long\": \"artist\",\r\n            \"def\": \"artist name\",\r\n            \"desc\": \"artist\",\r\n        },\r\n        {\r\n            \"short\": \"k\",\r\n            \"long\": \"api_key\",\r\n            \"def\": \"apikey\",\r\n            \"desc\": \"access token\",\r\n        }\r\n    ]\r\n}\r\n```\r\nThe response I'm getting in the browser, with the following call\r\n`https://ws.audioscrobbler.com/2.0/?method=artist.getSimilar&artist=airbag&limit=5&api_key=myapikey`\r\nis something like this:\r\n```\r\n<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n<lfm status=\"ok\"><similarartists artist=\"Airbag\"><artist><name>Nosound</name>\r\n<mbid>797c5264-2edc-4718-b3fc-ee30b343a0fd</mbid>\r\n<match>1</match>\r\n<url>http://www.last.fm/music/Nosound</url>\r\n<image size=\"small\">http://img2-ak.lst.fm/i/u/34s/b7b889567c9245b292ed8fc034edf8ec.png</image>\r\n<image size=\"medium\">http://img2-ak.lst.fm/i/u/64s/b7b889567c9245b292ed8fc034edf8ec.png</image>\r\n<image size=\"large\">http://img2-ak.lst.fm/i/u/174s/b7b889567c9245b292ed8fc034edf8ec.png</image>\r\n<image size=\"extralarge\">http://img2-ak.lst.fm/i/u/300x300/b7b889567c9245b292ed8fc034edf8ec.png</image>\r\n<image size=\"mega\">http://img2-ak.lst.fm/i/u/b7b889567c9245b292ed8fc034edf8ec.png</image>\r\n<image size=\"\">http://img2-ak.lst.fm/i/u/arQ/b7b889567c9245b292ed8fc034edf8ec.png</image>\r\n<streamable>0</streamable>\r\n</artist>\r\n<artist><name>RPWL</name>\r\n<mbid>80301f91-cb5a-4f02-bd2a-ead999a7dc06</mbid>\r\n<match>0.778902</match>\r\n<url>http://www.last.fm/music/RPWL</url>\r\n<image size=\"small\">http://img2-ak.lst.fm/i/u/34s/e3e2a5496af34b64bf3ad02d983986ea.png</image>\r\n<image size=\"medium\">http://img2-ak.lst.fm/i/u/64s/e3e2a5496af34b64bf3ad02d983986ea.png</image>\r\n<image size=\"large\">http://img2-ak.lst.fm/i/u/174s/e3e2a5496af34b64bf3ad02d983986ea.png</image>\r\n<image size=\"extralarge\">http://img2-ak.lst.fm/i/u/300x300/e3e2a5496af34b64bf3ad02d983986ea.png</image>\r\n<image size=\"mega\">http://img2-ak.lst.fm/i/u/e3e2a5496af34b64bf3ad02d983986ea.png</image>\r\n<image size=\"\">http://img2-ak.lst.fm/i/u/arQ/e3e2a5496af34b64bf3ad02d983986ea.png</image>\r\n<streamable>0</streamable>\r\n</artist>\r\n...\r\n</similarartists>\r\n</lfm>\r\n```"},"comment":{"url":"https://api.github.com/repos/tikalk/commandcar/issues/comments/160758417","html_url":"https://github.com/tikalk/commandcar/issues/9#issuecomment-160758417","issue_url":"https://api.github.com/repos/tikalk/commandcar/issues/9","id":160758417,"user":{"login":"shaharsol","id":672778,"avatar_url":"https://avatars.githubusercontent.com/u/672778?v=3","gravatar_id":"","url":"https://api.github.com/users/shaharsol","html_url":"https://github.com/shaharsol","followers_url":"https://api.github.com/users/shaharsol/followers","following_url":"https://api.github.com/users/shaharsol/following{/other_user}","gists_url":"https://api.github.com/users/shaharsol/gists{/gist_id}","starred_url":"https://api.github.com/users/shaharsol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaharsol/subscriptions","organizations_url":"https://api.github.com/users/shaharsol/orgs","repos_url":"https://api.github.com/users/shaharsol/repos","events_url":"https://api.github.com/users/shaharsol/events{/privacy}","received_events_url":"https://api.github.com/users/shaharsol/received_events","type":"User","site_admin":false},"created_at":"2015-11-30T20:52:55Z","updated_at":"2015-11-30T20:52:55Z","body":"I believe the error occurs because your hostname contains a path section (\"/2.0\"). This should go on the path template instead. Can you try that out and see if it works?"}}