Skip to content

Conversation

@LeadFreeCandy
Copy link
Contributor

Pull Request

Description

Please include a summary of the changes and the related issue (if applicable). Please also include relevant motivation and context. List any dependencies that are required for this change (if applicable).

Fixes # (issue)

Type of change

  • Bug fix (change which fixes an issue)
  • Enhancement (change which alters existing functionality)
  • New feature (change which adds new functionality)
  • This change requires a wiki/documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Try to checkoff as much as possible if not everything!

@LeadFreeCandy
Copy link
Contributor Author

LeadFreeCandy commented Sep 23, 2023

@Tripplenut This workflow looks less than ideal. There's no way we're going to be doing multiple merges into feature branches and then merging the merges back into main? Our commit history will look awful. I will fix these branches when I have time but students should be doing a rebase instead

this is 7 commits for slight changes to 1 file... interactive rebasing will be necessary

@anthonyfabius
Copy link
Contributor

@LeadFreeCandy The thing is I rebased. Unless I'm just stupid and don't know how git rebase works but my process for each rebase is just:

git checkout feature-branch
git rebase main
git pull
git push

I think the history gets fucked cause I always forget to pull before the rebase and i'm just too lazy to fix it. Also if you wish to teach each person proper git techniques go for it. I don't really mind them just knowing how to commit, merge, and make a pr. I don't think the git workshop will be going over anything other than those 3 as we discussed it during the mentor meeting. If you want to teach them rebase, squash, and cherry pick make sure you do it well and we will also need to change some repo permissions.

Created a function to find the closest label to the passed input field.
Then used a loop to iterate through all the input fields and fill them
with their closest label. Still very buggy and in testing phase.
Copy link
Contributor Author

@LeadFreeCandy LeadFreeCandy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some great ideas! Not ready to merge but I'm really liking where this is heading!

Comment on lines 2 to 16
function labelDist(labels: Element[], input: Element): Element {
let minDist = Number.MAX_VALUE;
let minLabel = labels[0];
for (let i = 0; i < labels.length; i++) {
let dist = Math.abs(labels[i].getBoundingClientRect().top - input.getBoundingClientRect().top);
if (dist < minDist) {
minDist = dist;
minLabel = labels[i];
}
}
return minLabel;
}


// This file will be run on the content page, and should include all the logic for inserting text into form items.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really interesting way to do this. Getting the actual rendered position is really cool! I think this would be a good fallback approach.

I think the first thing we should do is simply grab the label with something like this:
const label = document.querySelector(label[for="${inputField.id}"]);

if the website has its accessibly set up correctly, or use any decent form builder these should already be set up and will probably be more robust

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think i commented out a loop that did this with email fields. Just commented it out so it wouldnt interfere witht the testing

*/

// Trigger agree to terms and conditions. Tested on "https://store.steampowered.com/join" but should work on any site with a checkbox with the word "agree" in the name. Proof of concept for checkboxes
const agreeToTerms = document.querySelector('input[name*="agree"]');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha a robot agreeing to terms and conditions... we definitely might want to discuss whether we can really ethically do this. Maybe worth looking into a way to take the user to the fields that they must fill out manually for ethical reasons? Js has a really easy scrollTo method and we could highlight the field. Not necessary in this PR just something to think about

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can also autocheck captchas too lol, but I thought that was a tad too far

timelord1102 and others added 13 commits September 29, 2023 17:11
New scripts to find fields and uses LLM to fill them
… of input parameters, then uses GPT-3.5 to fill in fields.
and memory wise. Also added a new feature to autofill allowing for AI completion
of dropdown menus.

The algoritm continues to use GPT to generate the proper field response.
The new drop down algorithm passes GPT all possible options allowing it
to choose the appropriate response.
AI responses are stripped of "AI :" prefixes. Dropdowns consitantly filled.
AI responses made even more accurate by providing multiple data points to the AI.
These include the field label, name and ID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants