{"id":17190784,"url":"https://github.com/stestagg/al-sentiment","last_synced_at":"2026-01-06T01:06:32.022Z","repository":{"id":145766528,"uuid":"14747058","full_name":"stestagg/al-sentiment","owner":"stestagg","description":"A tool to track brand-specific sentiments using Twitter-like APIs","archived":false,"fork":false,"pushed_at":"2013-11-27T20:38:40.000Z","size":264,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T05:27:33.576Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stestagg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-27T12:58:20.000Z","updated_at":"2013-11-27T20:38:40.000Z","dependencies_parsed_at":"2023-03-23T03:17:06.313Z","dependency_job_id":null,"html_url":"https://github.com/stestagg/al-sentiment","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stestagg%2Fal-sentiment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stestagg%2Fal-sentiment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stestagg%2Fal-sentiment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stestagg%2Fal-sentiment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stestagg","download_url":"https://codeload.github.com/stestagg/al-sentiment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245407773,"owners_count":20610234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T01:23:57.429Z","updated_at":"2026-01-06T01:06:31.981Z","avatar_url":"https://github.com/stestagg.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"al-sentiment - [![Build Status](https://travis-ci.org/stestagg/al-sentiment.png)](https://travis-ci.org/stestagg/al-sentiment)\n============\n\nA tool to track brand-specific sentiments using Twitter-like APIs\n\nRunning\n=======\n\nal-sentiment is a standard flask app tested against python 2.7 and 3.3 on OSX and Ubuntu.\n\nTo run the web server:\n\n1. Clone the git repository (or unpack from a tarball)\n2. Optionally, create a virtual-env and enter that\n3. Install the requirements in requirements.txt (`pip install -r requirements.txt`)\n4. If it's not executable, make 'runserver' executable `chmod +x runserver`\n5. Run the runserver script `./runserver`\n6. The web server will shortly start serving requests on `http://localhost:5000`\n\nTo start using the app, browse to this URL, and click 'Fetch more messages'\n\nBy default the server will run with an in-memory database, to specify a\npersistent database file, add `--database=/path/to/sqlite3/file` to the command-line.\n\nDatabase setup is handled automatically by al-sentiment, if the file pointed to\nby `--database` is not present, it will be created.\n\nMore runtime options are available, and can be seen by running `./runserver --help`\n\nDesign\n------\n\n`sentiment` is a fairly standard python-flask app, that uses peewee as an ORM layer.\n\nThe App code is split into three main modules (under sentiment/):\n\nserver.py - responsible for option parsing, providing the webserver endpoints, and running flask\nmodels.py - defines standard peewee models (tracking users and tweets)\nfeed.py - responsible for interactions with the feed API\n\nThe tweet data is persisted to a sqlite3 database, managed by PeeWee (location determined by command-line arguments), the data model is very simple:\n\n![Data model](datamodel.png)\n\nBy splitting out the users into a separate table, assumptions were made about what\nthe 'followers' element of the twitter data represented.  `sentiment` assumes\nthat the tweet `follower` field represents the users's current follower count\n(at the time the tweet was sent).  The user table is kept up-to-date with\nthe latest follower count seen for each user, but does not do any timestamp\ncomparison, so out-of-order tweets coming from the API may affect the correctness\nof this value.\n\nBecause the Users table is keyed by string, the Tweets table still contains useful information\nwhen queried in the absence of the Users table, because each entry has the handle of the sender\nalongside the tweet, this would have implications if users were able to change their handle,\nbut that information is not available over the API anyway.  \n\nThe performance overheads of having an indexed string primary key were not considered\nsignificant for this scenario.\n\nTests\n-----\n\nAll tests, and coding style checks are run on travis-ci, the current build status may be\nseen at the top of this readme.\n\nTests are designed to be run by python-nose.  Unit-tests are defined in test modules alongside the\napplication code (for example sentiment/feed_test.py) and test functionality in the accompanying file.\n\nIntegration tests (added more as a demonstration of intent than anything particularly useful at this stage)\nare defined separately under the top-level directory: integration/, these tests \nspawn an instance of the web server with an in-memory databse and can be used\nto excercise the whole application.  There needs to be a way to specify custom\nfeed data to the server for more useful testing to be performed.\n\nTo run the tests, you may need to install the dependencies in test-requirements.txt\nthen just call `nosetests` in the top-level directory.\n\nWith more time, I would move much of the testing that happens in the integration/ part\ninto inline tests that use the flask test_app functionality, this would allow for\nricher fixture setup (and actually useful tests) The integration/ tests would then\nbecome selenium tests that could use a custom data source to excercise the full\nUI and javascript stack.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstestagg%2Fal-sentiment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstestagg%2Fal-sentiment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstestagg%2Fal-sentiment/lists"}