dws - script to show distrowatch rankings for time/distribution selections
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 3730
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
Very simple script, shows you distrowatch ranking for any distro or distros, and shows their daily page hit averages for the selected time period, and for day/month time frames, also if they are dropping, rising, or level relative to the previous day's average.

Changes:
  • 1.3.4 2013-10-20 - made output shorter for multiple distro output, for shell output, added space padding so output looks nicer. Also got rid of deprecated 'seq' use to future proof it.
  • 1.3.3 2012-01-04 - Bug fix to resolve two failures, one grep behavior changing slightly, and the other the distrowatch page code changing slightly, easy modification, just update with -U if you don't have the current version and your distro watch watching will proceed as normal.

:: Code ::
cd /usr/local/bin && wget -O dws smxi.org/dws && chmod +x dws


Typical script for me, check -h for options.

-U updates it from smxi.org.

-d tells it what distro to test for, see -h for details. You can check multiple distros by creating a comma separated list.
-t 7|30|3|6|12|200[2-9] selects what time span to check with.

default, no args, is debian 7 day stats.

You can change the default by editing the top 3 lines.

:: Code ::
dws -d arch -t 2008
arch distrowatch.com 2008 year ranking: 17 (465)

dws -d fedora
fedora distrowatch.com 7 day ranking: 2 (1622+)

dws -d openbsd,opensolaris,pcbsd -t 30
Distrowatch.com 30 day rankings:
openbsd:     93 (154+)
opensolaris: not ranked
pcbsd:       31 (430~)


has error handling, and should tell you pretty much what went wrong when something fails.

Newly developed feature: if you chown the script to your user name, it allows for user level updates, that took a while to figure out how to do.

and that's about it, another odd little script made for little reason other than I think i was just bored today.
Back to top
Display posts from previous:   

All times are GMT - 8 Hours