Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What sites are using my GitHub hosted script?

Suppose I have a JavaScript script named foo.js in a GitHub repo. I need to know what sites (domains) are using this script. Thus, for instance, if a website www.example.com is referencing my script...

<html>
  <head>
    <script src="https://myGitHubRepo/foo.js"></script>
  </head>
  etc...
</html>

I'd like to get, track or list example.com as a domain. To be more clear, I don't want to track actual users visiting www.example.com nor their IPs nor anything like this, I just want to track or make a list of the sites (domains) referencing my script in their HTMLs. Is that possible?


PS: some hypothetical solutions and their problems:

  1. The first idea that comes to mind is using an analytics tool; however, despite being the owner of my code, I'm not the owner of the site containing the repo: GitHub is the owner. Therefore, using an analytics tools seems to be impossible.
  2. I can't do calls to my server: again, I don't have a server, it's a GitHub repo.
  3. A simple window.location.hostname in the script would get what I want, but it would get it on the client side. I don't know if it's possible sending that information back to me... actually, I don't even know if that is legal.
like image 549
Megaptera novaeangliae Avatar asked May 23 '20 01:05

Megaptera novaeangliae


People also ask

What is my GitHub Pages URL?

Unless you're using a custom domain, project sites are available at http(s)://<username>.github.io/<repository> or http(s)://<organization>.github.io/<repository> .

What is GitHub hosted on?

GitHub hosts Linux and Windows runners on Standard_DS2_v2 virtual machines in Microsoft Azure with the GitHub Actions runner application installed. The GitHub-hosted runner application is a fork of the Azure Pipelines Agent.

How do I get a domain from GitHub?

On GitHub, navigate to your site's repository. Under your repository name, click Settings. In the "Code and automation" section of the sidebar, click Pages. Under "Custom domain", type your custom domain, then click Save.


1 Answers

Don't do it. Telemetry is tricky - and people will opt to not use your script.

Also without "place" to gather this information you cannot do it on github.

You can try leveraging "code" search engines like: https://publicwww.com/ https://www.nerdydata.com/

and similars

like image 56
Damian Avatar answered Sep 20 '22 02:09

Damian