Strava pruning




So after the start of the month the Strava timeline is full of everyone has "joined a challenge", and then gosh everyone has completed 10% of their challenge, and X has completed a challenge and so on.

Alright there are more annoying things to be bothered by in the world and some people might be really into these challenges, but I'm really not all that interested and I quite like just seeing activities people have done. Unfortunately there's no way to modify or configure these in the normal Strava settings. Although it is "something they are thinking about"

So what to do...

So firstly, the web interface... thankfully the Strava web interface is really clean and nicely designed. What if we just inspect the elements, aha! they have nice unique and explanatory class id's... we can just use ublock or something similar, add a bunch of rules and clear them all away.

strava.com###suggested-follow-module
strava.com###dorado-module
strava.com###invite-your-friend-module
strava.com##.group-entry.feed-entry.challenge
strava.com##.feed-entry.challenge
strava.com##.feed-entry.club


Sorted. Albeit got a little carried away there and also tidied away the friend suggestions and prompts to "hey you might like premium"... despite already being a premium user.


Now, more complicated - what about the Android app, we're a bit more limited in what we can do here.

But. I have a rooted phone so I can just browse the files and see what we have. ok. so there's a sqlite3 database for the Strava app:

# sqlite3 /data/data/com.strava/databases/strava
lets have a rummage about in there.... one ".schema", "select * from", etc etc later on and....

The table feed_entries appears to contain the details for items in the timeline, looking at the values it looks like type "1" is a normal activity entry, so lets run a little query and see what the other types are:


sqlite> select feed_entry_type, name, athlete_firstname, headline from feed_entries where feed_entry_type!=1;

-1|||
5|||New Feature!
0|||
5|||Premium Pays for Itself
999|||
3|The Great 13.1 Record|John|
8|CHAINGANG|Mark|


Great! OK, so type "8" appears to be club messages, "5" is adverts from Strava, "3" is notifications about challenges.

Running another query and "999" contains a whole load of info and looks to be the "Suggested Athletes" information.

Now I'm not interested in any of these in my mobile Strava timeline so... what's a nice simple way of clearing them away. First could we somehow update the Strava app to remove the types? Waay too complicated and we'd have to keep doing it each time the app was updated.

Now if this was a proper database app there'd be a stored procedure to retrieve the information we could modify. What can sqlite3 do... triggers? oooh I didn't know that - it supports database triggers.

So what about an update trigger? As soon as an item is added into the feed_entries table we could just check what it was, and change it somehow.

Lets think....

CREATE TRIGGER feed_trigger
AFTER insert on feed_entries
WHEN (NEW.feed_entry_type in (3,8,5,999))
BEGIN
  DELETE from feed_entries where _id=NEW._id;
END;


Ok, once a new row is added, check if it's one of the types we're not interested in and just delete it.

and give it a spin... refresh Strava. and whoosh. gone. Nothing but a series of activities in my timeline. Nice.

*Update* I found a nice chrome extension for Strava tweaking if you use Chrome: https://chris-lamb.co.uk/projects/strava-enhancement-suite

Comments