Skip to content

GSA/gogogon

 
 

Repository files navigation

Gogogon

Gogogon is system for consuming the 1.USA.Gov click feed and generating daily rankings of 1.USA.Gov URLs.

The origin of gogogon is a todder's pronunciation of "octagon".

Output

Gogogon produces daily JSON and CSV files aggregated by the global hash.

The JSON file is an array of objects, one object for each short link. The structure of the objects is,

  • u: URL
  • title: page title
  • global_clicks: daily click count
  • agency: e.g., nasa.gov
  • global_hash: bit.ly global hash

JSON sample output

The CSV file has the same content in comma-separated values. The structure is,

Long URL,Page Title,Clicks,Agency Domain,Global hash

CSV sample output

Processes

  • consumer.py continuously reads the feed and writes daily logs of all clicks
  • ranks.py daily reads the previous day's log file and generates the output files

Requirements

This distribution comes with support for pip and virtualenv in order to isolate the python packages in a virtual environment. See http://www.saltycrane.com/blog/2009/05/notes-using-pip-and-virtualenv-django/ for more deail on how and why this is a good idea.

Run the 'bootstrap.sh' command to get the virtual environment set up:

virtualenv --no-site-packages --distribute ve
source ve/bin/activate
pip install -r pip-requirements.txt

To start supervisord within the virtual environment you may need to start a subshell command of the form:

(. ve/bin/activate; export PATH=$PATH:.; supervisord -c supervisord.conf )

This will activate the virtual environment in the subshell, add the CWD to the path, and start supervisord.

Licence

(The MIT License)

Copyright © 2011 Measured Voice

Copyright © 2011 Blackstone Technology Group

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

1.USA.Gov daily ranked URLs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published