Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excluding @user replies in Twitterizer

I'm using the excellent Twitterizer to get a user's timeline, however I'd like to exclude @user replies from this returned collection.

The Twitter API offers a 'exclude_replies' parameter, but I can't find anything similar in the Twitterizer documentation.

Is there any way in which I can do this? Thanks in advance.

like image 553
Jonathan Avatar asked Jan 27 '26 15:01

Jonathan


2 Answers

It doesn't appear as though we have implemented that parameter yet. I've logged it as Issue 111.

like image 105
Ricky Smith Avatar answered Jan 29 '26 04:01

Ricky Smith


You might have to filter the replies once you've got them. Presumably you have a TwitterStatusCollection. There are some likely looking properties in each TwitterStatus, such as InReplyToUserID.

You could presumably (I haven't tried it) do something like this:

var filtered = myTimeline.Where(s => s.InReplyToUserID == null);

Or, failing that, filter out any statuses with the "@..." pattern in the text.

like image 22
Matthew Strawbridge Avatar answered Jan 29 '26 06:01

Matthew Strawbridge



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!