1.11M Members

diafol's dwAPI microsite

 
0
 

Hi all, following a chat with Dani, I'm just posting an example of a jQuery OAuth implementation. Major updates to come over the next weeks and months, but it's a start. I'll be publishing the code once I've cleaned it up and de-noobified it somewhat. :)

http://dw.diafol.org/

 
0
 

I get a 500 server error :(

 
0
 

Fixed!

Yep, I was having issues with GETTEXT, so had to swap a few include files around - but I got them in the wrong order!

 
0
 

I love the Twitter Boostrap look!! Spiffy!!

 
0
 

Two things ...

  1. You probably want to pass ?include_self=1 when you fetch /forums/descendants to include the top level categories as well, and not JUST their descendants.
  2. I'm not sure if it's related to that or not, but my list has an article that says f: undefined. It points to this thread: http://www.daniweb.com/hardware-and-software/microsoft-windows/viruses-spyware-and-other-nasties/threads/448757/cannot-download-attachments-in-gmail
 
0
 

Thanks for the heads up. I didn't know about the include_self! OK, I just hope I get the same json format :)

 
0
 

OK, I just hope I get the same json format :)

You will! However, it seems like it isn't able to determine the forum name when you're in a sub-forum, like one of the sub-forums within Microsoft Windows. Are you sure you're pulling descendants and not just children?

 
0
 

Ok, I've added the parameter - does it work for you now?

 
0
 

No :(

 
0
 

OK, I'll hard code your fave forums into my code and see if I can replicate the problem.
Hmm, it's stopped working - can't splice the json - did you change anything?

Ah - I now see the "0": etc 'keys'

 
0
 

I didn't change anything????

 
0
 

Oh shoot, you're right! I did break something!! Fixing ......

 
0
 

Fixed. Sorry about that.

 
0
 

Don't ya just love working with a moving target API? :)

 
0
 

GRR, not fixed ... hold on :)

 
0
 

NOW fixed.

 
0
 

OK, you've officially given me a freaking headache. :)
He he.

 
0
 

I was trying to add pagination and I accidentally put the pagination object inside the data object ... All good now.

 
0
 

OK, I think I tracked down the problem. If you have a top-level forum as your favourite, then children don't get taken into account in my code, so although the posts will be extracted, the program can't identify the forum as it has no id-title array item. OK, that went totally over my head until now. I've been beating my head against a wall as to why Forum 10 kept showing an undefined title. :)

//OK I think I've sorted it now - that was horrible :( Managed to sort it without a recursive function - but will probably need to do that to tidy up the code.

I extracted json from the nested forums (without descendants and include_self) as that allowed me to search children easily (nested loops).

 
1
 

Diafol,

I might be confused, but I don't think that you should need to do any type of nested loops.

Just look at the list of my favorite forums when you pull /me

Then, do:

http://www.daniweb.com/api/forums/1;2;3;4;5/descendants?include_self=1

This will give you a flat list of all of my favorite forums and all their descendants.

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: