How do I filter Blogger JSON Labels? (.grep/.filter)?


#1

So I was reading the articles here for JSON labels/categories post lists and I was wondering if it would be possible to:

As www . mybloggertricks . com / extract-category-list-from-blogger-JSON-feed.html describes it,

Using a /feeds/posts/default/-/LABELHERE?published&alt=json-in-script&callback=XXXXXX

Search through all X number of posts and retrieve all of the post labels in Blogger’s JSON URL with XXXXXX callback

Can I use javascript’s .filter, or .grep to pick out only CERTAIN labels (so I can create ‘hidden’ labels and have those ignored) and put those labels into a variable that I can use later and if so, how would I go about it?

I’m trying to edit some of the JS available on this site to make a filteredLabels variable that I can use somewhere else.

I appreciate the help, thanks!


#2

If I could phrase my question differently and focus on .grep, based on this StackExchange Q&A:

stackoverflow . com /questions/21172289/filtering-a-json-array-using-jquery-grep

var data = { “items”: [{ “id”: 1, “category”: “cat1” }, { “id”: 2, “category”: “cat2” }, { “id”: 3, “category”: “cat1” }] };

var returnedData = $.grep(data.items, function (element, index) { return element.id == 1; });

alert(returnedData[0].id + " " + returnedData[0].category);

Blogger categories seemingly are already placed in a array, but how would one call upon them? To what extent is

json.feed.entry[i].category[j].term used?

Hopefully someone has an answer for me, thanks for looking of course.