ruby on rails - Streamlined way to validate website ownership (with javascript?) -


I have a rail app that users need to verify that they have a website before submitting a link to that site. Are the owners of.

I have implemented a website verification system which thanks to the given answers. This system works but it is quite hard for users. For this, they need to create a web page on their site with a specific verification key for the url. I think I'm asking the user to jump through a lot of hoops to submit their pages to my site. However, site verification is important, and I can not leave this feature, though cumbersome.

I am looking for some JavaScript code that will help in validating websites. When users install the plugin, they must do all those things which click on "Verify" on the web app, and all the work is done for them.

I have an unconscious imagination how to get started ...

One step: They do not have to work to create a new web page and remove it.

The JavaScript code is to be placed on the website (Simplified version of Google Analytics code):

  "script type = 'text / javascript' id =" verification code generated by Rail App " & Gt; (function () {var secondScript = document.createElement ('script'); second script. Type = 'text / javascript'; second script src = 'http://www.mywebapp.com/verify.js '; Var firstScript = document.getElementsByTagName (' script ') [0]; First script parentNode.insertBefore (second script, first class }}}}} ();  In the second script (verify.js)  
  // Find some way to make sure that the first script " Verification Key "ID // If so, return some data that can understand and verify the Rail App site  

Any ideas?

There are other ways to verify website ownership: Many companies will send e-mails to the domain's registrant. Create a file with a certain name. Put a piece of specific text in the header of the indicator page. I think the way you are striving above is as complex as it needs. It is very easy for any webmaster to create a file with a certain name and certain content, I've done it several times for different devices.

Do not sweat it: -)


Comments