cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
179
Views
1
Helpful
3
Replies

API call to retrieve blocked domains list

bbcoder
Level 1
Level 1

Hi,

I use OpenDNS family shield and really appreciate the ability to view the blocked list, but don't often take the time to log in and actually view it. I'd like to simplify this by making an API call to retrieve the daily blocked list, and send it as an email notification. What I haven't been able to find is a simple way to make this API call.

I recognize that, when logged in, the URL is similar to this: https://dashboard.opendns.com/stats/all/topdomains/2015-09-11/blocked.print, of course using the date of the day I'm interested in. The trouble is the login process. Ideally I'd be able to perform an HTTP GET to that URL (or some similar URL), providing my username and password in the Authentication header. Unfortunately, a GET to that URL just results in a redirect to the login html page.

I've looked at the code used in this project: https://github.com/opendns/opendns-fetchstats, and while it would seem to work, it's also very brittle. Having to capture and parse html forms and cookies is incredibly inefficient and prone to break the next time there are changes to the website.

Is there a REST API which I can use for this purpose? If not, is there another method that would allow me to do an automated pull of the blocked report?

Thanks in advance!

3 Replies 3

rotblitz
Level 6
Level 6

See here: https://support.opendns.com/entries/21691004-opendns-fetchstats
You can fully automate everything.

bbcoder
Level 1
Level 1

Thanks rotblitz. I see how this could be done using fetchstats, I'm just concerned that the method that fetchstats is using to authenticate is likely to break anytime there is a change to the opendns website and was hoping that there was a more direct (stateless) method of accomplishing the same thing.

I'm thinking about creating a web application that could simplify this process for myself and others, since it's clearly something people want to do but is not a straight-forward process for non-technical users. I could use the same method that fetchstats does to negotiate a login, but would prefer not to go that route if there is a better alternative.

@bbcoder Did you ever make that web application you were speaking about back in 2015?