We have a webshop and using the shop's API we're able to fetch orders. On the other hand we have our wholesaler but they don't have an API, so we can't post orders to their system. They do have an online ordering form. Is there any way to auto fill this form from our script on our server to their script on their server?
I was googling the topic but I came across scripts that fill forms from the same page, not a different page on a different server.
p.s. this question is not intended to create spamming bots ;)
if i really understand that what u asked i think u must should use Selenium Web Driver that u can get information from a link and use them to auto fill the desired form , Selenium available on Java, Python , Ruby and ...
Related
I have an excel file that contains around 3000 unique ids. I am creating a HTML form where the user will select a code from one of these ids. Similar to something where they click on the code field, which takes them to a new web page where they can either search a specific code or just select to show all and then manually select one code.
I am assuming that I need to use JavaScript or something similar over here to connect the excel file to the form, but I cannot find a specific answer to the question. I have seen a lot of websites like job application websites where they have you search for the university do something similar. But I am not sure where to begin. It would be great if someone pushed me into the right direction.
Javascript on the frontend (in a web browser) does not have access to the filesystem. You should use NodeJS (Javascript Runtime) which does run on the server side, and therefore has access to the filesystem.
Your specific issues can be solved with a simple HTTP GET or POST request to a small NodeJS server which will take the code as a query parameter and proceed according to the requirements you have.
I hope this helps.
I am trying to build a webform that will copy all of the form fields to another, external website. I am making a separate sign up form for USA Judo (https://webpoint.usjudo.org/wp/Memberships/Join.wp) but I need to send the formfield data from my version of the form to the original website. I do not have control over the original website.
Any ideas? I'm completely lost here.
Thanks.
-Scott
The long and short answer is, unfortunately you can't.
Without having control over the original website, there is no way to pre-populate forms remotely.
The website you have stated also has a multi step signup form, which would make automatically filling it in not straight forward.
Cross Site Request Forgery is adopted in most modern browsers to stop sending forms to remote websites unless setup specifically todo so.
I am making a small payment system, basically it's just a point system, you pay say 1 USD and you get 100 points which is used later on in a game project to get bonuses. It's a script for game servers, something like a user panel.
Now, the script system is ready, but I'm afraid to give it away, since than someone will share it and it will spread all over the gaming area. What would be the solution keeping it working only if I give them a permission?
I thought about re-making whole code and make it work on my website but I don't think that people will want to put their SQL data to website that located NOT on their host. Please help me out, at least with some clues, maybe its possible to make some widgets? or maybe some license system?
I'm really lost.
You should implement the logic on the server side as an api REST call and include in the script only an ajax call to the api. You can limit the use of the api through an api key that you'll provide only to qualified sites.
You'd need to implement some sort or serverside authentication/api so that only varified users can use the script. Much like how software checks a licence.
On script load your javascript could make a ajax call to a server passing through the users IP, auth key, username etc etc.
This can then be varified on the server, maybe returning a dynamically generated url containing a javascript file which contains your business logic
(so that urls are dynamically generated for that users session only)
That way people cant hot link the script, and the script you give out is solely the ajax call
(With the business logic script injected on auth)
I have a very simple issue and I'm looking for a simple way to do that.
In fact, I'm searching to auto-fill a Web-Form from an official webPage of an institution and I would like to do it in Javascript into a webpage which will do it automatically on client-side.
I tried CasperJS/PhantomJS which is very useful to do that but they have to be run by command line and not by a js script.
This webForm is very simple.It has several dropdownList, checkboxes and text input with a simple submit button.
I don't need some detailed code but just the way/tools to achieve that. I'm on it since 2 weeks without any good results.
Ideally, this should be done server to server. What you want is a web service. This way you don't have to have a client machine with a browser sitting open to handle this.
A quicker and dirtier method would be to submit the form data directly to the 3rd party web server via cURL:
https://superuser.com/questions/149329/what-is-the-curl-command-line-syntax-to-do-a-post-request
http://curl.haxx.se/docs/httpscripting.html
The best way to do that is using Selenium. Use Selenium and you can easily fill out forms of third party.
I have a client request on one of my projects where they want to be able to enter a url and have it pull in some information form the site who's url they entered and save it in the database.
So the user enters: http://www.example.com/2342342 and my controller visits that site, and gets the content of the first <h1>Tag</h1> on the site and saves this in the database. Is this possible? If so, how would I go about doing it? Would I use some rails commands to do it, or something else, like jQuery?
Nokogiri is a great parser and can work directly with an url.
So two steps there:
Instantiate a Nokogiri object with the url as param
Parse the html page to get what you expect
Find instructions here: http://nokogiri.org/tutorials/parsing_an_html_xml_document.html
Because you'll work with another website, keep in mind two advice:
wrap your queries so that you can rescue if the website is down
consider using ajax request because it could be long
I would checkout the Railscast here:
http://railscasts.com/episodes/190-screen-scraping-with-nokogiri
It's explained very well on how to use Nokogiri and scrape content from other sites.