diafol's dwAPI microsite
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/
Related Article: Daniweb API Timestamp as UTC?
is a solved DaniWeb Community Feedback discussion thread by diafol that has 9 replies, was last updated 2 months ago and has been tagged with the keywords: daniweb-api.
diafol
Keep Smiling
10,668 posts since Oct 2006
Reputation Points: 1,632
Solved Threads: 1,514
Skill Endorsements: 57
I get a 500 server error :(
Dani
The Queen of DaniWeb
21,359 posts since Feb 2002
Reputation Points: 1,555
Solved Threads: 368
Skill Endorsements: 122
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!
diafol
Keep Smiling
10,668 posts since Oct 2006
Reputation Points: 1,632
Solved Threads: 1,514
Skill Endorsements: 57
I love the Twitter Boostrap look!! Spiffy!!
Dani
The Queen of DaniWeb
21,359 posts since Feb 2002
Reputation Points: 1,555
Solved Threads: 368
Skill Endorsements: 122
Dani
The Queen of DaniWeb
21,359 posts since Feb 2002
Reputation Points: 1,555
Solved Threads: 368
Skill Endorsements: 122
Thanks for the heads up. I didn't know about the include_self! OK, I just hope I get the same json format :)
diafol
Keep Smiling
10,668 posts since Oct 2006
Reputation Points: 1,632
Solved Threads: 1,514
Skill Endorsements: 57
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?
Dani
The Queen of DaniWeb
21,359 posts since Feb 2002
Reputation Points: 1,555
Solved Threads: 368
Skill Endorsements: 122
Ok, I've added the parameter - does it work for you now?
diafol
Keep Smiling
10,668 posts since Oct 2006
Reputation Points: 1,632
Solved Threads: 1,514
Skill Endorsements: 57
Dani
The Queen of DaniWeb
21,359 posts since Feb 2002
Reputation Points: 1,555
Solved Threads: 368
Skill Endorsements: 122
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'
diafol
Keep Smiling
10,668 posts since Oct 2006
Reputation Points: 1,632
Solved Threads: 1,514
Skill Endorsements: 57
I didn't change anything????
Dani
The Queen of DaniWeb
21,359 posts since Feb 2002
Reputation Points: 1,555
Solved Threads: 368
Skill Endorsements: 122
Oh shoot, you're right! I did break something!! Fixing ......
Dani
The Queen of DaniWeb
21,359 posts since Feb 2002
Reputation Points: 1,555
Solved Threads: 368
Skill Endorsements: 122
Dani
The Queen of DaniWeb
21,359 posts since Feb 2002
Reputation Points: 1,555
Solved Threads: 368
Skill Endorsements: 122
Don't ya just love working with a moving target API? :)
Dani
The Queen of DaniWeb
21,359 posts since Feb 2002
Reputation Points: 1,555
Solved Threads: 368
Skill Endorsements: 122
GRR, not fixed ... hold on :)
Dani
The Queen of DaniWeb
21,359 posts since Feb 2002
Reputation Points: 1,555
Solved Threads: 368
Skill Endorsements: 122
Dani
The Queen of DaniWeb
21,359 posts since Feb 2002
Reputation Points: 1,555
Solved Threads: 368
Skill Endorsements: 122
OK, you've officially given me a freaking headache. :)
He he.
diafol
Keep Smiling
10,668 posts since Oct 2006
Reputation Points: 1,632
Solved Threads: 1,514
Skill Endorsements: 57
I was trying to add pagination and I accidentally put the pagination object inside the data object ... All good now.
Dani
The Queen of DaniWeb
21,359 posts since Feb 2002
Reputation Points: 1,555
Solved Threads: 368
Skill Endorsements: 122
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).
diafol
Keep Smiling
10,668 posts since Oct 2006
Reputation Points: 1,632
Solved Threads: 1,514
Skill Endorsements: 57
Dani
The Queen of DaniWeb
21,359 posts since Feb 2002
Reputation Points: 1,555
Solved Threads: 368
Skill Endorsements: 122