Skip to content

Instantly share code, notes, and snippets.

@mrvdb
Last active August 29, 2015 14:02
Show Gist options
  • Save mrvdb/dde3a80656ee78d1474b to your computer and use it in GitHub Desktop.
Save mrvdb/dde3a80656ee78d1474b to your computer and use it in GitHub Desktop.
diff --git a/actions/apitimelineuser.php b/actions/apitimelineuser.php
index d3e3ba8..7c44871 100644
--- a/actions/apitimelineuser.php
+++ b/actions/apitimelineuser.php
@@ -228,8 +228,15 @@ class ApiTimelineUserAction extends ApiBareAuthAction
while ($notice->fetch()) {
if (count($notices) < $this->count) {
- // TODO: a feed without replies would be useful (extra param?)
- $notices[] = clone($notice);
+ if(array_key_exists('postsonly',$this->args) && $this->args['postsonly']==1) {
+ if ($notice->get_object_type(True) == 'note') {
+ // Only include notes, no comments
+ $notices[] = clone($notice);
+ }
+ } else {
+ $notices[] = clone($notice);
+ }
} else {
$this->next_id = $notice->id;
break;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment