{"action":"opened","issue":{"url":"https://api.github.com/repos/juju/jujusvg/issues/22","labels_url":"https://api.github.com/repos/juju/jujusvg/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/juju/jujusvg/issues/22/comments","events_url":"https://api.github.com/repos/juju/jujusvg/issues/22/events","html_url":"https://github.com/juju/jujusvg/issues/22","id":65478248,"number":22,"title":"Have a fallback default charm icon when none is found.","user":{"login":"marcoceppi","id":70613,"avatar_url":"https://avatars.githubusercontent.com/u/70613?v=3","gravatar_id":"","url":"https://api.github.com/users/marcoceppi","html_url":"https://github.com/marcoceppi","followers_url":"https://api.github.com/users/marcoceppi/followers","following_url":"https://api.github.com/users/marcoceppi/following{/other_user}","gists_url":"https://api.github.com/users/marcoceppi/gists{/gist_id}","starred_url":"https://api.github.com/users/marcoceppi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcoceppi/subscriptions","organizations_url":"https://api.github.com/users/marcoceppi/orgs","repos_url":"https://api.github.com/users/marcoceppi/repos","events_url":"https://api.github.com/users/marcoceppi/events{/privacy}","received_events_url":"https://api.github.com/users/marcoceppi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-31T15:28:14Z","updated_at":"2015-03-31T15:28:14Z","closed_at":null,"body":"I attempted to implement this but ended up driving the generation time up linearly. After an attempt to refactor to use go routines I promptly gave up. Here is the linear implementation and an example of what it generates:\r\n\r\n```golang\r\nfunc iconURL(ref *charm.Reference) string {\r\n    url := \"https://api.jujucharms.com/v4/\" + ref.Path() + \"/archive/icon.svg\"\r\n    resp, err := http.Head(url)\r\n    if err != nil {\r\n        log.Fatalf(\"err %s\\n\", err);\r\n    }\r\n\r\n    if resp.StatusCode == 404 {\r\n        url = \"https://jujucharms.com/static/img/icons/default-charm.svg\"\r\n    }\r\n\r\n    return url\r\n}\r\n```\r\n\r\nhttp://svg.juju.solutions/?bundle-file=https://raw.githubusercontent.com/whitmo/bundle-kubernetes/master/bundles.yaml\r\n\r\nNot sure if having the charmstore API return default-charm icon would be a better place to have this logic @mitechie ?"}}