0

It seems very random. I have already limited the search result to 10 nos. only by

return jsonify(rows[:10])

under application.py

@app.route("/search")
def search():

I found the same issue in the staff's solution. I just want to know why or which lines of code create this behaviour.

Moreover, I found my article results different to the staff's articles. Is it due to my google account setting? It seems to me that the news are actually related to the postal code location, but different set of articles are selected for me. I limited the no. of articles to be displayed in Google Map Info to be less than 5. But I don't think it is the problem, as I checked the staff's solutions via http://pset8.cs50.net/articles?geo=02138 and mine via https://ide50-username.cs50.io/articles?geo=02138. They are just different.

1 Answer 1

1

Random by design. Review the sql(s) in the update function of application.py and the reason will be revealed. That's the sql(s) used to populate the data sent to addMarker.

The staff's solution for articles returns 5 rows. The default for google news RSS is 10 rows. So it seems that the staff solution is not using the same version of helpers.py as is supplied in the distro code, or some other unknown (and unknowable) variation in the software. From the spec:

Additionally, you can search for location based news by modifying parameters in the URL, like the ones below. For a full list of parameters you can check out this guide.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .