Wednesday, July 8, 2009

Explanation of “No related posts found.”

The blogger of As the crow flies (this blog has good photos, go check it out) asked a question about why is one of her post gets no results. I have seen many blog posts seem to have same problem from server logs, but this is the first time I got asked. Probably a good time to address the issue for you.

Here is a short answer:

When BRPS inquires about
  • same label posts, or
  • specific post's labels
to Google Blogger, sometimes, Blogger replies with 404 NOT FOUND. Which might mean there is
  • no posts under such label, or
  • no such post,
but there is actually some posts are filed under such label or there indeed has that post. The cause is unknown to me, and I am not able to resolve this. When this happens, it may result “No related posts found.” to your blog posts.

Fortunately, the problem is not permanent. If BRPS inquires again later, it may get the correct result if Blogger no long respond 404. But, since BRPS has 24 hours cache time for each post's labels and same label posts list, the result will have to wait at least 24 hours (up to 48 hours) to get updated.

Please bear with this issue if this badly happens on your blogger.

10 comments:

  1. Hi Yu-Jie,
    I think you did some great work with this code. It is exactly what I need. Thank you very much.
    I have a question: you supply the client code, however if I would want to host my own related post server (I have also an appengine account), what would I have to do?
    thank you in advance,
    Benjamin.

    ReplyDelete
  2. Hi,
    If you don't plan to modify the code, I suggest that you still use the brps.appspot.com instead of running on your own.

    However, if you have such plan to modify (Remember, it's open source, you need to release your source code!), I could give few points (Sorry! I really don't have such mood to write about it. Someone had asked me months ago, but I didn't give out any instructions at that moment.)

    I hope you know AppEngine and Python.

    Here is the very rough steps:
    1) Change application ID from brps to [YourID] in app.yaml.
    2) Change brps.appspot.com to [YourID].appspot.com in brps.js and some HTML templates under template, and maybe some other place mention "brps."
    3) Put a copy of simplejson under src/simplejson, that is necessary, GAE still uses Python 2.5, AFAIK.
    4) Upload and pray!

    ReplyDelete
  3. Hi Yu-Jie,
    thanks a lot for your explanation. Isn't here missing something? There is the caching mechanism which you can put into app.yaml, but to do this for each request it should be more involved, at least that's what I expected. Maybe you can give more detailed instructions when are in better mood ;). Anyways, I'll run it from your app engine for now, but I might try it out from mine some time later.
    I thought it might be useful to host it myself, because of server load (there are quota for appengine, as you know, if many people use your service, you might run into trouble) and because I hope to have less HTTP requests.
    You wrote a great tool. I am going to post about it.
    Thanks again,
    Benjamin.

    ReplyDelete
  4. Hi Benjamin,

    I don't know what kind of caching mechanism you were referring to about app.yaml, please give me for info.

    I am afraid that I couldn't give any detailed instructions in near future. Sorry!

    In deed, the free quota have almost been run out, http://brizzly.com/pic/67Q.

    However, there are few some tweak that I could do to reduce the server load. Once again, not in the mood to do so yet.

    ReplyDelete
  5. Hi again,
    saw your stats. So, that's what a successful app look like!
    I fully understand that you don't want to give a beginner's tutorial on how to set up brps. I'll try out what you said and come back to you. I might do so this evening if I have time.

    ReplyDelete
  6. Hi Yu-Jie,
    thanks a lot for your explanations! I made it work. It was as you said. I was surprised it was that simple!
    Please tell me if you find any tweaks.
    bye,
    Benjamin.

    ReplyDelete
  7. Hi Benjamin,

    Glad to hear that you made it work. :)

    ReplyDelete
  8. Hi Yu-Jie,
    you could simplify the brps python code by changing the loading of simplejson to from django.utils import simplejson as json. This makes it unnecessary to download and add simplejson (it is part of django already).
    As I am writing to you I am also editing a post about your related post scripts. I am thinking about offering people to use my installation as well.

    ReplyDelete
  9. @Benjamin, thanks for the tip! I will change in next commit. And I will be looking forward to seeing you releasing your own version.

    ReplyDelete
  10. @Benjamin, I checked out the Django 0.96 in GAE SDK, it's using simplejson 1.5, almost three years ago. I think the production server has same version of simplejson.

    I decided not to go with that change.

    ReplyDelete

This is not for posting your problems. If you have any in using BRPS, please post at here.