Need a project partner

Find a consultant or advertise your services here
Post Reply
access2vivek
Posts: 69
Joined: Wed Dec 20, 2017 10:00 am
Location: New Delhi, India
Contact:

Need a project partner

Post by access2vivek » Sun Mar 28, 2021 5:35 pm

Hello iMacros Developers,

I have been working on a project for a while that uses PaleMoon browser with iMacros 8.9.7.
The code is written in Javascript and Google Sheets is used as the database.
I am working on automating form-filling on a job portal. Since job applications are being done on multiple sites, there is a lot of pending work.

Let me know if anyone is interested in helping me with the application. Note that it is a long-term project. For further details, you can send me an email.

Regards,
Vivek Agrawal
Last edited by Tom, Tech Support on Mon Mar 29, 2021 6:46 pm, edited 1 time in total.
Reason: Fixed typo in title
Robust iMacros development with quick turnaround time. Drop an email at "access2content@gmail.com" with your project details.
chivracq
Posts: 9766
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Need a project partner

Post by chivracq » Sun Mar 28, 2021 6:04 pm

access2vivek wrote:
Sun Mar 28, 2021 5:35 pm
Hello iMacros Developers,

I have been working on a project for a while that uses PaleMoon browser with iMacros 8.9.7.
The code is written in Javascript and Google Sheets is used as the database.
I am working on automating form-filling on a job portal. Since job applications are being done on multiple sites, there is a lot of pending work.

Let me know if anyone is interested in helping me with the application. Note that it is a long-term project. For further details, you can send me an email.

Regards,
Vivek Agrawal

Yep, sounds like an interesting Project indeed..., but hum..., don't you notice the ugly Typo in your Thread Title...? (Corrected in my Reply...) :shock:

OK, Good Luck, and post some Update maybe in the Thread once you'll have found your "perfect Partner"... :idea:

(I'm not "interested" for myself, I don't do '.js' Scripts, and I'm just "Happy" with helping Users for Free on the Forum... :P :wink: )
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
User avatar
thecoder2012
Posts: 427
Joined: Sat Aug 15, 2015 5:14 pm
Location: Internet
Contact:

Re: Need a project partner

Post by thecoder2012 » Sun Mar 28, 2021 8:07 pm

access2vivek wrote:
Sun Mar 28, 2021 5:35 pm
For further details, you can send me an email.
Without video chat and desktop sharing (except it's required for bugs) ?
I have seen this project request but only with desktop sharing, video chat and more in my last email contact.
Join 9kw.eu Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me! :idea:
access2vivek
Posts: 69
Joined: Wed Dec 20, 2017 10:00 am
Location: New Delhi, India
Contact:

Re: Need a project partner

Post by access2vivek » Tue Mar 30, 2021 10:03 am

thecoder2012 wrote: Without video chat and desktop sharing (except it's required for bugs) ?
I have seen this project request but only with desktop sharing, video chat and more in my last email contact.
I am not quite sure that I understood what you are asking @thecoder2012. I had asked the owner of the project to contact you, but I don't know any other detail about that interaction.

Let me know if you are interested in the project and a way to connect with you. I would be happy to share the demo, code, and everything else with you.
Robust iMacros development with quick turnaround time. Drop an email at "access2content@gmail.com" with your project details.
access2vivek
Posts: 69
Joined: Wed Dec 20, 2017 10:00 am
Location: New Delhi, India
Contact:

Re: Need a project partner

Post by access2vivek » Tue Mar 30, 2021 10:06 am

chivracq wrote: Yep, sounds like an interesting Project indeed..., but hum..., don't you notice the ugly Typo in your Thread Title...? (Corrected in my Reply...) :shock:
I think I was in a hurry which is why I didn't spot that :lol:
chivracq wrote: OK, Good Luck, and post some Update maybe in the Thread once you'll have found your "perfect Partner"... :idea:
Will most definitely update the thread.
chivracq wrote: (I'm not "interested" for myself, I don't do '.js' Scripts, and I'm just "Happy" with helping Users for Free on the Forum... :P :wink: )
I found '.js' scripts to be more powerful and easier to maintain (Just my opinion). Thank you for always helping people in the forums.
Robust iMacros development with quick turnaround time. Drop an email at "access2content@gmail.com" with your project details.
techimac
Posts: 402
Joined: Fri Feb 20, 2015 9:27 pm

Re: Need a project partner

Post by techimac » Thu Apr 01, 2021 4:31 am

Google Sheets is used as the database

Can you share code to read data from Google Sheets?
chivracq
Posts: 9766
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Need a project partner

Post by chivracq » Thu Apr 01, 2021 12:38 pm

techimac wrote:
Thu Apr 01, 2021 4:31 am
Google Sheets is used as the database

Can you share code to read data from Google Sheets?

Hum, yep indeed..., I was also "wondering" how you (@OP) had implemented "that"..., so I would be "curious" as well to see that part of your Script... :P

'Google-Sheets' are always a bit "problematic" to use with iMacros, doesn't "really" work with the "standard" 'TAG' Mode in my "Experience", or you need to use 'EVAL()' to re-isolate all Data Col by Col / Row by Row / Cell by Cell..., which is a bit cumbersome of course... :|
=> Need to use the 'EVENT' Mode, or the 'TAG XPATH' Mode..., I would think..., or will need to extract/access the Data "directly" from JS with 'getElementByID()' etc..., which will also be a bit cumbersome, I would think... :?
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
techimac
Posts: 402
Joined: Fri Feb 20, 2015 9:27 pm

Re: Need a project partner

Post by techimac » Thu Apr 01, 2021 2:30 pm

if you have a working iMacros code to read google sheets then you can share and I will help you in return in code if you get stuck.
access2vivek
Posts: 69
Joined: Wed Dec 20, 2017 10:00 am
Location: New Delhi, India
Contact:

Re: Need a project partner

Post by access2vivek » Sun Apr 04, 2021 7:48 pm

techimac wrote:
Thu Apr 01, 2021 4:31 am
Google Sheets is used as the database

Can you share code to read data from Google Sheets?
Ok, so I use a simple trick to use Google Sheets as the database. I use the Google Apps Script to create two methods - "doGet" and "doPost" to fetch and push data to the sheet. Once the doGet and doPost functions are written (which is pretty simple), you can deploy the script as "web app" and you will get a URL which is used as an endpoint by the iMacros code. The URL would be something like - "https://script.google.com/macros/s/XXXX ... XXXXX/exec".

Here is the Google Apps Script (GAS) code for doGet(). You will need to pass the name of the sheet as the parameter while calling the API with a 'GET' request.

Code: Select all

function doGet(e) {
  let sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(e.parameter.sheet);
  
  var data=sheet.getDataRange().getValues();
  var headers=data[0];
    
  var output=new Object();
  output.row=[];
  var row;
    
  for(var i=1;i<data.length;i++)
  {
    row=new Object();
    for(var j=0;j<data[0].length;j++)
      row[headers[j].replace(/ /g,"")]=data[i][j];
      
    output.row.push((row));
  }
  
  return ContentService.createTextOutput(JSON.stringify(output));
}
Here is the Google Apps Script (GAS) code for doPost(). You will need to pass the data object as string while calling the API with a 'POST' request.

Code: Select all

function doPost(e){
  
  var postData = JSON.parse(e.postData.contents);
  let sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(postData.sheet);

  var input=[];
  for(var i=0;i<postData.data.length;i++)
    input.push(postData.data[i]);

  sheet.appendRow(input);

  return ContentService.createTextOutput("OK");
}
Now, to fetch the data, you can do something like the following in your iMacros code:

Code: Select all

const XHR = Components.Constructor("@mozilla.org/xmlextras/xmlhttprequest;1");
let XHRRequest = XHR();
const api="https://script.google.com/macros/s/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/exec?sheet="+sheet;
XHRRequest.open('GET',api,false);
XHRRequest.send();
return JSON.parse(XHRRequest.response);
Note: I use the "sheet" parameter to specify the sheet from which I want to read data. This needs to be defined in the doGet function in the Google Apps Script.

To save data to Google Sheets, you can do the following in iMacros

Code: Select all

const XHR = Components.Constructor("@mozilla.org/xmlextras/xmlhttprequest;1");
let XHRRequest = XHR();
XHRRequest.open('POST',"https://script.google.com/macros/s/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/exec",false);
XHRRequest.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
XHRRequest.send(JSON.stringify(data));
Note: "data" here is a Javascript object.

This way, you can essentially use Google Sheets as a database for storing and retrieving data. I hope that this post becomes a good use-case for the iMacros community.

I know its hard to explain the concept in a thread. But I hope I am able to at least guide you in the correct direction. I hope it helps :-)
Robust iMacros development with quick turnaround time. Drop an email at "access2content@gmail.com" with your project details.
techimac
Posts: 402
Joined: Fri Feb 20, 2015 9:27 pm

Re: Need a project partner

Post by techimac » Mon Apr 05, 2021 4:36 pm

Thanks.
Tom, Tech Support
Posts: 3705
Joined: Mon May 31, 2010 4:59 pm

Re: Need a project partner

Post by Tom, Tech Support » Tue Apr 06, 2021 10:27 am

access2vivek wrote:
Sun Apr 04, 2021 7:48 pm
techimac wrote:
Thu Apr 01, 2021 4:31 am
Google Sheets is used as the database

Can you share code to read data from Google Sheets?
Ok, so I use a simple trick to use Google Sheets as the database. I use the Google Apps Script to create two methods - "doGet" and "doPost" to fetch and push data to the sheet. Once the doGet and doPost functions are written (which is pretty simple), you can deploy the script as "web app" and you will get a URL which is used as an endpoint by the iMacros code. The URL would be something like - "https://script.google.com/macros/s/XXXX ... XXXXX/exec".

Here is the Google Apps Script (GAS) code for doGet(). You will need to pass the name of the sheet as the parameter while calling the API with a 'GET' request.

Code: Select all

function doGet(e) {
  let sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(e.parameter.sheet);
  
  var data=sheet.getDataRange().getValues();
  var headers=data[0];
    
  var output=new Object();
  output.row=[];
  var row;
    
  for(var i=1;i<data.length;i++)
  {
    row=new Object();
    for(var j=0;j<data[0].length;j++)
      row[headers[j].replace(/ /g,"")]=data[i][j];
      
    output.row.push((row));
  }
  
  return ContentService.createTextOutput(JSON.stringify(output));
}
Here is the Google Apps Script (GAS) code for doPost(). You will need to pass the data object as string while calling the API with a 'POST' request.

Code: Select all

function doPost(e){
  
  var postData = JSON.parse(e.postData.contents);
  let sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(postData.sheet);

  var input=[];
  for(var i=0;i<postData.data.length;i++)
    input.push(postData.data[i]);

  sheet.appendRow(input);

  return ContentService.createTextOutput("OK");
}
Now, to fetch the data, you can do something like the following in your iMacros code:

Code: Select all

const XHR = Components.Constructor("@mozilla.org/xmlextras/xmlhttprequest;1");
let XHRRequest = XHR();
const api="https://script.google.com/macros/s/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/exec?sheet="+sheet;
XHRRequest.open('GET',api,false);
XHRRequest.send();
return JSON.parse(XHRRequest.response);
Note: I use the "sheet" parameter to specify the sheet from which I want to read data. This needs to be defined in the doGet function in the Google Apps Script.

To save data to Google Sheets, you can do the following in iMacros

Code: Select all

const XHR = Components.Constructor("@mozilla.org/xmlextras/xmlhttprequest;1");
let XHRRequest = XHR();
XHRRequest.open('POST',"https://script.google.com/macros/s/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/exec",false);
XHRRequest.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
XHRRequest.send(JSON.stringify(data));
Note: "data" here is a Javascript object.

This way, you can essentially use Google Sheets as a database for storing and retrieving data. I hope that this post becomes a good use-case for the iMacros community.

I know its hard to explain the concept in a thread. But I hope I am able to at least guide you in the correct direction. I hope it helps :-)

Very clever, awesome that you shared this! The only thing I would clarify is that this is not an iMacros-specific solution, and in fact requires no iMacros code at all - it is all being done via Javascript. But otherwise, I understand what you mean when you say "you can do the following in iMacros". It is the iMacros scripting interface that enables the Javascript to load and execute.
Regards,

Tom, iMacros Support
Post Reply