{"action":"created","issue":{"url":"https://api.github.com/repos/hypeJunction/hypeScraper/issues/12","labels_url":"https://api.github.com/repos/hypeJunction/hypeScraper/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/hypeJunction/hypeScraper/issues/12/comments","events_url":"https://api.github.com/repos/hypeJunction/hypeScraper/issues/12/events","html_url":"https://github.com/hypeJunction/hypeScraper/issues/12","id":55505417,"number":12,"title":"extractURLs is sometimes returning duplicate urls","user":{"login":"propertunist","id":513903,"avatar_url":"https://avatars.githubusercontent.com/u/513903?v=3","gravatar_id":"","url":"https://api.github.com/users/propertunist","html_url":"https://github.com/propertunist","followers_url":"https://api.github.com/users/propertunist/followers","following_url":"https://api.github.com/users/propertunist/following{/other_user}","gists_url":"https://api.github.com/users/propertunist/gists{/gist_id}","starred_url":"https://api.github.com/users/propertunist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/propertunist/subscriptions","organizations_url":"https://api.github.com/users/propertunist/orgs","repos_url":"https://api.github.com/users/propertunist/repos","events_url":"https://api.github.com/users/propertunist/events{/privacy}","received_events_url":"https://api.github.com/users/propertunist/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-26T16:43:30Z","updated_at":"2015-01-26T17:03:27Z","closed_at":null,"body":"i have integrated hypeScraper correctly into my site so that links are automatically processed for specific views (e.g. full object views). i just came to extend the integration so that videos that are loaded on pinboard pages (from matt's au_sets plugin) are also scraped, instead of being a fixed, embedded object.\r\nin the process of doing that, i found that the embedded objects were/are being duplicated, so that 2 embeds are added to the page, instead of one.\r\ni thought at first that this must be a bug that i have introduced somewhere in my integration, however, once i debugged to find the cause, i found that i can pass a single youtube url into the function called 'extractURLs' and it will return an array containing 2 urls, instead of one (which is the cause of the duplication.\r\ni don't know why this is occurring presently."},"comment":{"url":"https://api.github.com/repos/hypeJunction/hypeScraper/issues/comments/71495480","html_url":"https://github.com/hypeJunction/hypeScraper/issues/12#issuecomment-71495480","issue_url":"https://api.github.com/repos/hypeJunction/hypeScraper/issues/12","id":71495480,"user":{"login":"propertunist","id":513903,"avatar_url":"https://avatars.githubusercontent.com/u/513903?v=3","gravatar_id":"","url":"https://api.github.com/users/propertunist","html_url":"https://github.com/propertunist","followers_url":"https://api.github.com/users/propertunist/followers","following_url":"https://api.github.com/users/propertunist/following{/other_user}","gists_url":"https://api.github.com/users/propertunist/gists{/gist_id}","starred_url":"https://api.github.com/users/propertunist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/propertunist/subscriptions","organizations_url":"https://api.github.com/users/propertunist/orgs","repos_url":"https://api.github.com/users/propertunist/repos","events_url":"https://api.github.com/users/propertunist/events{/privacy}","received_events_url":"https://api.github.com/users/propertunist/received_events","type":"User","site_admin":false},"created_at":"2015-01-26T17:03:27Z","updated_at":"2015-01-26T17:03:27Z","body":"ah, this is caused when the text and the href of the <a> element both contain a valid url, so they are both being extracted and returned as unique urls.\r\ni have worked around this in my integration by setting a limit of 1 in the $vars array when i call output/url_preview"}}