02/18 - Syrup-y Saturday!

Status
Not open for further replies.

Concise

Buddhist Bacchante
Joined
Apr 28, 2016
Messages
4,092
Reaction score
6,398
Points
813
Hello night owls, here is a present.

Code:
// ==UserScript==
// @name         Cliff DesPeaux
// @namespace    https://gist.github.com/Kadauchi
// @version      1.0.0
// @description  Hotel Image Rating
// @author       Kadauchi
// @icon         http://i.imgur.com/oGRQwPN.png
// @include      /^https://(www\.mturkcontent|s3\.amazonaws)\.com/
// @hitsave      https://www.mturkcontent.com/dynamic/hit?hitId=38G0E1M85M4QD3BEYP7BMC8YT7YVU5
// @hitname      Hotel Image Rating
// ==/UserScript==

if (document.getElementsByTagName(`strong`)[0].textContent !== `How much is the image making you want to stay at the hotel?`) return;

function SHOW () {
  for (let i = 0; i < images.length; i ++) images[i].style.display = `none`;
  images[index].style.display = ``;
  counter.textContent = index + 1;

  for (let element of document.querySelectorAll(`[class="rate"]`)) element.style.backgroundColor = ``;
  for (let element of images[index].querySelectorAll(`[type="radio"]`)) if (element.checked) document.querySelector(`[class="rate"][value="${ element.value }"]`).style.backgroundColor = `lightgreen`;
}

function PREV () {
  if (index === 0) return;
  index --;
  SHOW();
}

function NEXT () {
  if (index === 9) return;
  index ++;
  SHOW();
}

document.getElementsByClassName(`container`)[0].insertAdjacentHTML(
  `afterend`,
  `<div class="text-center">` +
  `<button id="prev" style="margin: 3px;" type="button">Previous</button>` +
  `<button class="rate" value="1" style="margin: 3px;" type="button">1</button>` +
  `<button class="rate" value="2" style="margin: 3px;" type="button">2</button>` +
  `<button class="rate" value="3" style="margin: 3px;" type="button">3</button>` +
  `<button class="rate" value="4" style="margin: 3px;" type="button">4</button>` +
  `<button class="rate" value="5" style="margin: 3px;" type="button">5</button>` +
  `<button class="rate" value="6" style="margin: 3px;" type="button">6</button>` +
  `<button class="rate" value="7" style="margin: 3px;" type="button">7</button>` +
  `<button class="rate" value="8" style="margin: 3px;" type="button">8</button>` +
  `<button class="rate" value="9" style="margin: 3px;" type="button">9</button>` +
  `<button class="rate" value="10" style="margin: 3px;" type="button">10</button>` +
  `<button id="next" type="button">Next</button>` +
  `</div>` +
  `<div class="text-center"><span id="counter"></span> / 10</div>`
);

let index = 0;
const images = document.getElementsByClassName(`form-group`);
const counter = document.getElementById(`counter`);

for (let i = 0; i < images.length; i ++) {
  images[i].style.display = `none`;
  images[i].parentElement.className = `text-center`;
  images[i].parentElement.parentElement.className = `text-center`;
}

document.addEventListener(`click`, function (event) {
  const element = event.target;

  if (element.matches(`#prev`)) PREV();

  if (element.matches(`#next`)) NEXT();

  if (element.matches(`.rate`)) {
    document.getElementById(`rating${ index + 1 }-${ element.value }`).click();
    NEXT();
  }
});

window.addEventListener(`keydown`, function (event) {
  const key = event.key;

  if (key.match(/0/)) document.querySelector(`[class="rate"][value="1${ key }"]`).click();
  if (key.match(/[1-9]/)) document.querySelector(`[class="rate"][value="${ key }"]`).click();
  if (key.match(/Enter/)) document.querySelector(`[type="submit"]`).click();
});

SHOW();
Thank you for the script. Makes these pretty quick!

AA is 30 days looks like, anyone had any approved yet? No TO on this one. other than one yesterday, but no mention of paid. I just caught the comment above... fingers crossed!
 
Last edited:

WalkingEmphasis

Banned
Banned
Contributor
Joined
Apr 11, 2016
Messages
4,424
Reaction score
8,154
Points
888
Thank you for the script. Makes these pretty quick!

AA is 30 days looks like, anyone had any approved yet? No TO on this one. other than one yesterday, but no mention of paid. I just caught the comment above... fingers crossed!
Yeah, I did a lot of them, twice, not very long ago. Approved well before the AA, but I can't remember exactly how long it was. Pretty sure it was one or two days.
 

Concise

Buddhist Bacchante
Joined
Apr 28, 2016
Messages
4,092
Reaction score
6,398
Points
813
Okay, thanks folks. I'm used to seeing more T.O. history when requesters post batches that make workers happy...

And can I just say.. there are some very ugly ass decorators out there... some beautiful hotels, however some of them are sketch fest...
 
  • Like
Reactions: WalkingEmphasis

T. Leela

Oh Lord...
Contributor
Joined
May 12, 2016
Messages
11,050
Reaction score
14,046
Points
1,388
Location
Colorado
Gender
Female
I went back to 'yesterday' to check how to pick 10 for an answer on the script as I thought I saw something about it (I did and it's 0, duh) but I'm really confused...why when i got to the end of yesterday did is start over again? seriously? That was pretty scary. I've had way more than enough of frapping, thank you.
:tinfoil:
 

Drwho10

Mister Gank Yo Hits
Contributor
Joined
Jan 11, 2016
Messages
12,350
Reaction score
20,568
Points
1,388
Age
31
Location
Long Beach, CA
Gender
Male
Okay, thanks folks. I'm used to seeing more T.O. history when requesters post batches that make workers happy...

And can I just say.. there are some very ugly ass decorators out there... some beautiful hotels, however some of them are sketch fest...
I'd use TO as more of a secondary or tertiary way to figure out a good batch. Can I make it worth my time is #1 then I look at TO if there's anything relevant or recent otherwise I go by feel
 

Concise

Buddhist Bacchante
Joined
Apr 28, 2016
Messages
4,092
Reaction score
6,398
Points
813
I'd use TO as more of a secondary or tertiary way to figure out a good batch. Can I make it worth my time is #1 then I look at TO if there's anything relevant or recent otherwise I go by feel
We sort our own ways. If I've never worked with a requester, I read their T.O. first, always, then read a few pages on a forum or two to get a gist.

37K hits, 6 rejections, Masters. I work Mturk part time, in between other work.
 
Last edited:

T. Leela

Oh Lord...
Contributor
Joined
May 12, 2016
Messages
11,050
Reaction score
14,046
Points
1,388
Location
Colorado
Gender
Female
I keep thinking the script or the page or something is stuck because i get through them so much faster,
and it doesn't seem like I could be done w/ 10 already.
Anyway, I don't mind this. this is a very nice problem to have.
Thank you.
 

Jerami

Well-Known Member
Contributor
Crowd Pleaser
HIT Poster
Joined
Jan 24, 2016
Messages
14,405
Reaction score
25,210
Points
2,238
Looks like Mr AbdelFattah reversed a few of the rejections (not much tho)
FoxNews reports that sources close to Mr AbdelFattah said that he had, "made a mistake." He is quoted as saying, "I am sorry for reversing anything. It's a bit of a #$%^ sandwich. It may be winter but, I'm keeping warm, bundled up in all your stolen data. Bwah. Hah. Hah."

Back to you, Tom.

:mob::ahhh:
 

Drwho10

Mister Gank Yo Hits
Contributor
Joined
Jan 11, 2016
Messages
12,350
Reaction score
20,568
Points
1,388
Age
31
Location
Long Beach, CA
Gender
Male
FoxNews reports that sources close to Mr AbdelFattah said that he had, "made a mistake." He is quoted as saying, "I am sorry for reversing anything. It's a bit of a #$%^ sandwich. It may be winter but, I'm keeping warm, bundled up in all your stolen data. Bwah. Hah. Hah."

Back to you, Tom.

:mob::ahhh:
lmao maybe i'm just cynical but I feel like this sorta thing happens more often than you'd think. still rare but not as rare as it should be. Usually its just on a smaller scale
 
Last edited:
  • Like
Reactions: Jerami

Kadauchi

Well-Known Member
Master Pleaser
Crowd Pleaser
Joined
Jan 12, 2016
Messages
7,098
Reaction score
21,951
Points
1,263
I keep thinking the script or the page or something is stuck because i get through them so much faster,
and it doesn't seem like I could be done w/ 10 already.
Anyway, I don't mind this. this is a very nice problem to have.
Thank you.
This change will make it auto submit .
Code:
function NEXT () {
  if (index === 9) { document.querySelector(`[type="submit"]`).click(); return; }
  index ++;
  SHOW();
}
 

T. Leela

Oh Lord...
Contributor
Joined
May 12, 2016
Messages
11,050
Reaction score
14,046
Points
1,388
Location
Colorado
Gender
Female
This change will make it auto submit .
Code:
function NEXT () {
  if (index === 9) { document.querySelector(`[type="submit"]`).click(); return; }
  index ++;
  SHOW();
}
Thank you!
 

T. Leela

Oh Lord...
Contributor
Joined
May 12, 2016
Messages
11,050
Reaction score
14,046
Points
1,388
Location
Colorado
Gender
Female
This change will make it auto submit .
Code:
function NEXT () {
  if (index === 9) { document.querySelector(`[type="submit"]`).click(); return; }
  index ++;
  SHOW();
}
I actually managed to paste it wrong the first time. I don't even know how that's possible. Anyway its working great now that I managed to click 2 buttons correctly.
Seriously, I had to watch a couple of times because it didn't seem like I could be going through that many pictures. (I was of course).
 
Status
Not open for further replies.