Own DynDns Service, clientside script.


/ Published in: Ruby
Save to your folder(s)

Clientside script for a personal DynDNS service. Works together with a server-side script written in php [ http://snipplr.com/view/55482/own-dyndns-service-serverside-script ] .

You may want to set up a cron jop to run this script every x minutes.


Copy this code and paste it in your HTML
  1. require 'uri'
  2. require 'net/http'
  3.  
  4. url = "http://dynDNS.yourveryownhost.com"
  5. params = {
  6. 'updateIp'=>'',
  7. }
  8.  
  9. parsedUrl = uri = URI.parse( url );
  10.  
  11. http = Net::HTTP.new(parsedUrl.host, parsedUrl.port)
  12. request = Net::HTTP::Get.new(parsedUrl.path)
  13. request.set_form_data( params )
  14.  
  15. request = Net::HTTP::Get.new( parsedUrl.path+ '?' + request.body )
  16.  
  17. response = http.request(request)
  18. puts response.body

URL: http://madcity.at/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.