mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-22 13:03:46 +00:00
Twitter import from timeline, check if there are posting before the foreach loop
This commit is contained in:
parent
8e6d1d8f8b
commit
e5499d75db
1 changed files with 4 additions and 2 deletions
|
@ -615,6 +615,7 @@ function twitter_fetchtimeline($a, $uid) {
|
||||||
$items = $connection->get('statuses/user_timeline', $parameters);
|
$items = $connection->get('statuses/user_timeline', $parameters);
|
||||||
$posts = array_reverse($items);
|
$posts = array_reverse($items);
|
||||||
|
|
||||||
|
if (count($posts)) {
|
||||||
foreach ($posts as $post) {
|
foreach ($posts as $post) {
|
||||||
if ($post->id_str > $lastid)
|
if ($post->id_str > $lastid)
|
||||||
$lastid = $post->id_str;
|
$lastid = $post->id_str;
|
||||||
|
@ -654,5 +655,6 @@ function twitter_fetchtimeline($a, $uid) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
set_pconfig($uid, 'twitter', 'lastid', $lastid);
|
set_pconfig($uid, 'twitter', 'lastid', $lastid);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue