MahendraTanveer / phptumblr

Automatically exported from code.google.com/p/phptumblr
0 stars 0 forks source link

Cannot Limit Data. Always get everything. #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Even with the examples that come with the download, I always get every post 
returned. I cannot seem to limit the number of posts displayed. I cannot even 
get just an individual post to be displayed. 

I have a feeling that dumpArray always returns everything. There is mention of 
a getArray function in the documentation, however, that function does not 
exist. What am I doing wrong? I would expect that the below code would receive 
the first 3 posts. Yet is returns every post. 

$oTumblr = new readTumblr('joeworkman');
$oTumblr->getPosts(0,3,'all');
$aTumblr = $oTumblr->dumpArray();

Original issue reported on code.google.com by joework...@gmail.com on 27 Mar 2011 at 11:49

GoogleCodeExporter commented 9 years ago
It seems we have a bug. That's strange as I haven't changed anything on my 
debugging installation on my web host and the bug appears on it. Investigation 
in progress.

Original comment by my.name....@gmail.com on 28 Mar 2011 at 12:24

GoogleCodeExporter commented 9 years ago
Got it.

When phpTmblr initialize, it automatically make a call on API with num = 0, 
then a call for each post type (again with num = 0). The purpose of these API 
calls are to get the total number of posts for each post type. Seems like 
Tumblr somehow changed their API to not accept 0 as post number anymore, and 
return the default number (20) of posts. As a results, these posts are 
automatically added to the resulting array.

That'll need some work, maybe I'll make a new release tonight (tonight for me 
is tonight in the Europe/Paris timezone).

Original comment by my.name....@gmail.com on 28 Mar 2011 at 12:31

GoogleCodeExporter commented 9 years ago
Thank you VERY much! That is awesome! While you are working on things... any 
way to sneak in tag support?

Original comment by joework...@gmail.com on 28 Mar 2011 at 4:31

GoogleCodeExporter commented 9 years ago
Issue solved. The simplest workaround is to request 1 post (instead of 0) (1 is 
lighter than 20) and ignore it.

I'm packaging & uploading!

Original comment by my.name....@gmail.com on 28 Mar 2011 at 5:32

GoogleCodeExporter commented 9 years ago
If I set $start (the first parameter of getPosts) to anything but 0, I get an 
internal server error.... Here is my test site. 

http://sandbox.joeworkman.net/2011/blog/index.php?start=1

Original comment by joework...@gmail.com on 28 Mar 2011 at 6:30

GoogleCodeExporter commented 9 years ago
More on this issue. I notice that the bug only happens if the start value is 
1-5. Once I set it to 6 or above, we are golden. 

Original comment by joework...@gmail.com on 28 Mar 2011 at 6:36

GoogleCodeExporter commented 9 years ago
hm... lack of testing, sorry. Working on it.

Original comment by my.name....@gmail.com on 28 Mar 2011 at 6:44

GoogleCodeExporter commented 9 years ago
Got it fixed (or at least I hope so!). That was just a memory problem (the 
function that converts all the entities back to corrects utf8 characters 
couldn't make it through the multiple array levels).

Anyway, looking for the issue was the occasion for me to rewrite the getPosts 
function, so it's now more optimized and so on... Will work for adding ability 
to search posts by tag now!

Original comment by my.name....@gmail.com on 28 Mar 2011 at 9:04

GoogleCodeExporter commented 9 years ago
You are a rockstar!!!

Original comment by joework...@gmail.com on 28 Mar 2011 at 9:21

GoogleCodeExporter commented 9 years ago
The photos no longer seem to work. The photo posts don't  contain any images in 
the photos array. Oops!

I am using Cache and it seems that from time to time, getPosts is not returning 
any data. 

Original comment by joework...@gmail.com on 28 Mar 2011 at 11:31

GoogleCodeExporter commented 9 years ago

Original comment by my.name....@gmail.com on 29 Mar 2011 at 9:53

GoogleCodeExporter commented 9 years ago
Should have fixed the photo issue (see dedicated ticket).

If you encounter this issue when getPosts returns nothing again, open a ticket 
about that with the maximum information you can tell me about.

Original comment by my.name....@gmail.com on 29 Mar 2011 at 9:57

GoogleCodeExporter commented 9 years ago
I think that you can label this as being fixed. Thank you for your hard work. 

Original comment by joework...@gmail.com on 15 Apr 2011 at 6:30

GoogleCodeExporter commented 9 years ago

Original comment by my.name....@gmail.com on 15 Apr 2011 at 9:28