I want[#want]_ to get a list of labels after I read this post, which is about the blogger’s index page of his recipes. It’s handmade list and it’s kind of strange since the code uses jQuery but reload page for updating list of posts. I want to list all labels automatically and update list of posts in place.
Please view page source for the source code (BSD License). At this moment, it just literally lists all labels. As you can see, it’s not easy to read. I am thinking for a better way. Maybe split them by alphabets, put them into a drop down menu, or have something auto-completion feature in an input box? Of course, my final Labels (index) page will list posts as you seen in that recipes index page. But I will use Blogger API only, that index uses Yahoo! Pipes, another mystery to me.
There is one thing missing, the post counts of a label, the Blogger API doesn’t give us that information. For this point, you might be wondering why I don’t just parse content of Labels gadget. The reason is the content of Labels gadget is directly visible to search engine crawlers and they are not smart including Googlebot, they would match keywords on labels list. I don’t want people to visit my blog because that kind false match, therefore I don’t even use Labels gadget.
I am really not sure if I will continue to write this Labels page because honestly I have only clicked on other blogs’ label/tag links for a few times. I don’t really need to have a Labels page, it certainly is convenient but not really necessary for me to have one. For last 30 days, I got 14 out of 3328 pageviews on label pages, which is 0.434%. Do I really need one of that index page?
[1] | Actually I have been wanting to retrieve a list of labels since I knew about Blogger API, never knew how to do so. But hours ago, I googled for that again. This time I found this reply. |
Nice enhancements! The reason Yahoo Pipes was used is because the blogger api only returns 500 results at a time and Yahoo pipes can easily call the api 3 times to get the first 1500 results and the merge and sort them alphabetically. This could of course all be done in javascript as well.
ReplyDeleteI see and that made me check how many post you have. :) But I would prefer the official channel if that's still doable and without needing too much effort.
ReplyDeleteI haven't thought about alphabetical sorting, I might need to try 'title' on ORDERBY in API, Blogger API doc didn't mention 'published' can be used. You might not need to sort in your own script, just grab multiple times. In my current code, it's very easy to modify, just add a new parameter, then it can call API endlessly until there are no more posts to retrieve.
Blogger API doesn't support 'title' as sorting field. Well, anyway, I did it on my own. Now Labels can load all posts with one click, the code automatically send requests as many as it needs to list all posts. 1000+ posts (not my blog) take about three seconds, plus sorting time.
ReplyDeleteVisitors can change options. It shows how many posts we get. I also added colors. I love this new page, but I really doubt I would use it often.
Should I sneak Google Analytics code into it, so I can peek at what people do with it?
Hello, sorry a bit clueless! I want to have a permanent list visible on my blog under a tab to show my recipes by entree/Starter/dips etc. I've used your brilliant search box and it grabbed a few of my recipes http://aveganobsession.blogspot.co.uk/2012/09/all-recipes-by-index.html Will you please tell me how to set up a tab on the home page and get the search thing to grab the posts by Entree/Mains, Desserts etc. THANK YOU! So very much appreciated x
ReplyDeleteFrom what I read in your comments, you are asking about two things:
ReplyDeleteSet up a link (tab) on the home page
Make that page you linked list posts by entree/mains automatically when visitors browse to that page
The first task depends on your blog layout/template code. If it supports standard Blogger menu/nav gadget, you should be able to add a Page or a Link as a new tab. It it does not support, then you will need to edit HTML code.
The second task requires editing JavaScript code of mine. My current Search page is not open source, but older version is, you can get a link to the open source code from this post. (It's almost two years old, so the presentation of results are different, I think)
You will need to find someone to modify my open source code (BSD License) for you, so it can automatically search those entrees/mains when page is loaded.
I know you want to have a clear answer (code), unfortunately, I can't give you that. I'm currently not in the state to do code modification. Since I have open source version, then you can feel free to find someone to modify the code for you as much as you like. But you need to find someone else.
PS. Disqus marked you comment as spam.