Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solved: How to Query Raw Counts from Command Line #38

Open
JamesDBartlett3 opened this issue May 29, 2023 · 0 comments
Open

Solved: How to Query Raw Counts from Command Line #38

JamesDBartlett3 opened this issue May 29, 2023 · 0 comments

Comments

@JamesDBartlett3
Copy link

Here's how you can retrieve the raw count data from the command line using PowerShell:

$response = Invoke-WebRequest -Uri "https://hits.seeyoufarm.com/api/count/keep/badge.svg?url=https://your-website.com"
$content = $response.Content
$counts = ($content | Select-String -Pattern "[0-9]+ / [0-9]+" -All).Matches[0].Value
Write-Host "Counts: $counts"

image

The history graph data can be queried in a similar fashion using this endpoint:
https://hits.seeyoufarm.com/api/count/graph/dailyhits.svg?url=https://your-website.com
You'll need to do a lot of RegEx parsing to pull the historical data out of the SVG code, but the general principle is the same as my prior example above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant