Open bsima opened 11 years ago
A question: How to actually open a scrape the Footprints ticket
The issue is that Footprints' authentication method is difficult to work with. The SuperDSR Jumpfield is run in a separate context from the rest of the browser pages. So, there must be some way of passing information between the extension and the Tcenter ticket pages.
Solution: Chrome Message Passing. This allows you to send a notification from a content script to the background scripts of the extension. Especially see the Long-lived connections section.
Since the we will only be passing a notification to the extension from the content script, this means that we can piggyback on the current authentication session. No need to develop a separate authentication method for SuperDSR to interface with Shibboleth or Footprints.
So, what I need to do in order to develop this feature:
https://apps.rit.edu/~a-tcent/index.php?manualTicket=true&type=2
After research and a few attempts, using a modal to capture user input will prove to be a difficult way to program this. Instead, perhaps I could use jQuery to walk the user through the necessary information. Like those demos or tutorials, a field would be selected and a tooltip would instruct them what to do.
Nobody likes creating Tcenter tickets. A script can be made that pulls the requisite information from Footprints, and then enters the info into the necessary fields.
First, I will need to scrape the page with JavaScript. This can be done with pjscrape. The code should look something like this:
That's simple enough. A separate function would have to be executed for each element on the page, most likely (i.e. each
pjs
function would need a differentscraper
value), but that's no problem either. The difficult part would be figuring out how to open the proper ticket page. I think I first have to write the Footprints search before I can write the function to scrape the ticket page.There are a few things that the Tcenter ticket requires that I cannot get from the Footprints page. In addition, I will need the Footprints ticket ID to begin with. So, when one opens the Tcenter ticket creation page, they should be greeted with a modal that guides them through the process.
That's the basic code. Replace "Put stuff here" with the code for the form required info.
For some of these, we can attempt to scrape the Footprints ticket, and then ask for user input if no data is found.
Of course, there should also be a step to verify the information before submitting.