There is Oryx running on Ubuntu. It is configured to read csv files from some directory to update recommendations. What I need is to get full list of recommendations (all users and 100 recommendations per each user) to insert it back to Postgres database. How I can get those recommendations? API allows me only to retrieve recommendations for single user.
Asked
Active
Viewed 80 times
1 Answers
0
If I understand the question correctly, I think it just comes down to running a loop in a script. If you are able to get what you need from a query on a single user, then try writing a script to loop the query over all users. A pseudo-python script may look something like this:
import requests
# Define the endpoint to get a recommendation for a single user
endpoint = 'http://<SERVING LAYER IP>:8091/reccomend/'
# Loop this query over all users
for i in xrange(userID):
recommendation[i] = requests.get(endpoint + userID[i])
Of course, what you do with each recommendation[i] for each userID[i] depends on output format, etc., but the idea is to perform the single user query over all users using a script.

Rich
- 132
- 9
-
But is there any API to get all users IDs (I don't want to query DB for them...) – user606521 Nov 12 '14 at 08:49