XML of the FIRST Q & A system

Hey all…

Intrested in seeing xml data from the FIRST Q & A system??

Check out http://usfirst.firstsn.org/xml/qa.php

You can use the following queries in your url to access different info.

The queries are:
section=[Section]
date=[Date]
mmddyyyy=(MM/DD/YYYY)]
search=[Search]
status=[Status]
skip=[offset] NOTE: MAX 25 DISPLAY

An example url would be:
http://usfirst.firstsn.org/xml/qa.php?section=1&search=manual&status=answered

Take a look at the actual Q & A page to see what are the possible values you can enter for each of the fields.

Also, just to let anyone know, this script parses the FIRST site directly on every call so you’ll be guarenteed fresh data.

If anyone has any questions’s or actually finds a good way to use this let me know. :wink:

Jack

What I really want to know is if it’s possible to sort by newest posts… I find it rather annoying that the Q&A system only sorts by section and there’s no option to sort by date - makes it very hard to look for new questions. FIRST - if you’re out there, add an option to order the Q&A system by date… everything’s from a database, so it’s just a matter of adding a few lines of code.

As a side note, I’d like to register my disappointment with this year’s Q&A system. Some of the best engineers in the world can’t do better than this? Not only is the page cluttered and hard to read, but the questions can’t be sorted chronologically so you can’t see what has changed since the last time you have been there. Furthermore–speaking as my team’s official Q&A bottleneck–I have not been emailed a notice that my question has been answered a single time as of yet, and three of my questions have been answered. This is obviously at odds with the Q&A login page.

shakes head in disgust

$@#$@#$@#$@#.

–Petey

I’ll add this to the portal if anybody thinks it would be a good thing.
Anybody got any ideas on what I should add, if any? (answered, new questions, etc)

Newest five (or ten, whatever you want) answered questions.

It would be great if you could include, say, the latest 5 asked questions and the latest 10 answered questions.

Brandon, do you think you’d be interested in making your little inclusion script open source if the people who used it on their site gave CD (and you) the credit for it?

–Petey

I’ll add the 5 most recently answered questions.

As for making it open source, I’ll see what I have when I’m done.
I’m not sure how much of it will be vB3-specific.

That is one thing that i noticed is a limitation of the current way that i run the script. There isn’t an easy way of getting the latest posts. (IE… just running the vanila query returns the oldest q&a’s.)

I’ll do whatever i need to do to fix that & see if i can get the page to load a lot faster. I might scarcifice parsing the FIRST page every load for the trade off of a better sorting system.

I’ll give yall an update later.

Hey~

Well… I updated http://usfirst.firstsn.org/xml/qa.php

As of now, it’ll run a ton faster. The only downside to all of this is that the Q & A’s will only be updated from the FIRST site every 15-30 min. SO… While it won’t be totally correct minute-to-minute, it’ll be pretty close.

Here are the new values you can pass in the URL.

section=[This works just like the FIRST one. Passing 3 will return everything in and below section 3 such as 3.1, 3.1.1, etc… Passing 3.1 will return things in 3.1 and below such as 3.1.1 and 3.1.2 BUT NOT 3.2]
date=[asc/desc] - Note: This is just an order by statement. desc will return the newest q&a’s first, asc will return the oldest first
status=[answered/unanswered]… yup
start=[offset] - The script will only return a max of 30 records at a time. Start can be used to offset the beginning to start at like record 30 instead of record 0.

SO… An example would be: http://usfirst.firstsn.org/xml/qa.php?date=desc&section=3.2&start=5&status=unanswered

If you have any questions feel free to ask.

Hope this helps everyone!

Jack

Thanks Jack!

Hmm…now, how to import them onto a page and organize them so they’re not a bundle of gibberish.

–Petey

hey.

Just to let ya all know…

The cron now works. That means that the xml data that you pull will be updated from the USFIRST site every 15 minutes.

Also… If you’re looking for an easy way to display a link directly to a specific Q&A, you can use…

http://my.usfirst.org/frc/qas/FMPro?-db=web_frcqa.fp5&-format=qa_list.htm&-lay=web&-sortfield=section_lvl1_calc&-sortfield=section_lvl2_calc&-sortfield=section_lvl3_calc&-sortfield=section_lvl4_calc&-sortfield=status_response&-sortfield=_date_created&-op=neq&status_response=Rejected&-op=neq&status_response=Clarification%20required&-find=&-token.3=

Set -token.3= Like the first 75 chars of the question or something. That will then search the Q&A’s for whatever you put as -token.3 As long as you have enough of the question so that there is only one Q&A that matches it, you’ll be good.

Maybe I’ll get around to posting some code to parse the xml… i dunno :slight_smile:

Jack

Grr to usfirst.

Well… it appears that first played a bit with the Q&A page. Anyways… the long and short of it was that it threw off the parser and caused it to not end correctly. Anywho… by the time i saw something was wrong, instead of 175 records in the database, there were over a million. :slight_smile:

So… for now, i’ve stopped the parsing. I don’t want another occurance of this showing up again. I might remake this again in a few weeks when first has figured out the final source for the page.

Jack