[BF4/BF3ish]Battlefeed Filter - Better Battlelog Forums #111198

Sitemap
Post edited 4 x times, last by
Topicstarter
There is so much going on in the feed. With this you can select what you don't want to see. So far it can block battlereports, battlepacks, forum posts, and I am working on trying to block favorited servers.

https://dl.dropboxusercontent.com/s/zhvbkssvwknwmhr/feed_filter.js


Dropbox decided to move the file to a new URL. This one should work.

What do you think?
Update

23-12-2013 Added a filter to remove the friendship messages.
Post edited 1 x times, last by
GameFreakBoy wrote:
What do you think?

It's awesome. I don't really care about other peoples battle packs. Especially because most share literally every single one, not just an awesome bundle, etc.
Post edited 2 x times, last by
GameFreakBoy wrote:
There is so much going on in the feed. With this you can select what you don't want to see. So far it can block battlereports, battlepacks, forum posts, and I am working on trying to block favorited servers.

https://dl.dropboxusercontent.com/s/zhvbkssvwknwmhr/feed_filter.js


What do you think?


I think this might be what you're after for sniping those favorited servers:
$("#main-feed-container .feed-story-heading a[href^='/bf4/servers/show']").parents('li.feed-single-item').remove();
(
http://api.jquery.com/attribute-starts-with-selector/
)

Aside from that, I like it! I might actually, occasionally, glance at the battlefeed now.
Post edited 1 x times, last by
Nice plugin! Would be possible to block the unlocks too? And what about the campaign missions report?
Post edited 1 x times, last by
Dendari wrote:
Nice plugin! Would be possible to block the unlocks too? And what about the campaign missions report?


Well, for campaign missions, grabbing with this should do the trick:
$("#main-feed-container .feed-story-heading a[href^='/bf4/campaign/level']").parents('li.feed-single-item')

unlocks vary a bit based on type from what I can tell, but the people on my friends list aren't overly spam-tastic enough for me to test these:
code
$('.award-item').parents('.feed-story') // might cover everything, probably too much!
$('.award-item .vehicleunlock_unlock').parents('li.feed-single-item')
$('.award-item .dogtags').parents('li.feed-single-item')
$('.award-item .weapon_unlock').parents('li.feed-single-item')
$('.award-item .battlepacks').parents('li.feed-single-item')
$('.award-item .servicestar').parents('li.feed-single-item') or $('.award-item .award_star').parents('li.feed-single-item')
$('.award-item .award_ribbons').parents('li.feed-single-item')
$('.rank-icon').parents('li.feed-single-item')


As an added bonus, for the game-specific items (aka anything other than "now friends!")
code
$("span.common-gameicon-hori.common-game-2048-1").parents('li.feed-single-item') // BF4 - PC
$("span.common-gameicon-hori.common-game-2-1").parents('li.feed-single-item') // BF3 - PC
$("span.common-gameicon-hori.common-game-4096-1").parents('li.feed-single-item') // MOHW - PC


Values for common-game-<gameid>-<platformid>:
var games = {
BFBC2 : 1,
BF3 : 2,
BF1942 : 4,
BF1943 : 8,
BFVIETNAM : 16,
BF2 : 32,
BF2142 : 64,
BFBC : 128,
BFHEROES : 256,
BFMC : 512,
BFP4F : 1024,
/* */
WARSAW : 2048,
/* */
MOHW : 4096
};
var platforms = {
PC : 1,
XBOX360 : 2,
PS3 : 4,
XBOX : 8,
PS2 : 16,
PS4 : 32,
XBOXONE : 64
};


But... that's just things I tripped over in the process of digging through the code for my own purposes, it's up to GameFreakBoy to decide if he wants to go about sifting through all that :)
Topicstarter
Once I get back to my machine I will play with it. Im posting this from a tablet now. Thanks for the help poison. :)
I haven't used href very much.
Is it just me or it doesn't work if you're in the BF3 Battlelog?
Looks like it's just setup to run against BF4, though I believe the structure of the feed's the same on everything it uses, so it might be able to be applied directly to both.
Topicstarter
I was thinking of making an option to block all of bf4 feed from bf3.
Post edited 1 x times, last by
Topicstarter
This seems to want to delete all posts, even ones that have the BF3 icon. Any ideas?
var bf4Icon = $('span[class^=".common-game-2048-"]')
$("#main-feed-container .feed-story-infoarea").children().children(bf4Icon).parent().parent().parent().parent().parent().remove();


It worked without the variable. Although I can't say if it will work when other platforms other than PC are involved.
Any chance you could filter the friend messages, such as X and Y are now friends?
Post edited 1 x times, last by
Topicstarter
Just added it.
Try it out. :D
Can you please add blocking of BFH items in BF4 feed?