AP WebFeeds Manager parser
- An AP Exchange Saved Search news feed. At least one, but several can work at the same time. We've got ~16 going at a time.
- An AP WebFeeds Manager installation pointed at the AP Exchange news feed
- A working Django installation
- A cron job that inserts the AP stories resulting from the AP Exchange -> WebFeeds Manager XML into a Django database.
Then install the project requirements:
pip install -r requirements.txt
If running a manual restart from oper
account home directory on command line:
$ nohup java -jar [your_django_project]/ap_wfm/WebFeedsAgent.jar commandLine > /dev/null 2>&1 &
or try this if the above dies when you log out:
$ java -jar [your_django_project]/ap_wfm/WebFeedsAgent.jar commandLine > /dev/null 2>&1 &
(Remember, this is only to restart. First time runinng, you must supply userName
, password
and agentName
.)
To see if it's running (on Linux):
$ ps -ef | grep java
The key to getting it to run locally from within a virtual environment (so as to mimic a production type of environment) is to set the shebang on the first line of call_process_feed.py
to the path of the virtual environment Python, e.g.:
#!/Users/mac_username/Development/.virtualenvs/virtual_env_name/bin/python
Another tip: Set the logging level via the AP WebFeeds Manager
website interface to Debug
. (Profiles => Profile Preferences tab => Logging => Log level dropdown) Then search for SCRIPT OUTPUT
lines and the word "Traceback" for Python errors.
To get the ingestion script to run with a local, development set of settings:
python manage.py process_feed /Users/jheasly/Development/ap_wfm/WFA/feeds/All-TopHeadlines-JH/feed_644355_2015-06-02T16-39-38.445Z.xml --settings=test_root.local_settings