I think that i need to know the last one.
To find the router WAN IP address you can 1). go to your router's setup application and see the assigned WAN IP address there, 2). write some code to parse the return info from the http://www.whatismyip.com site, or use the www.no-ip.com service to do the work for you. Study up on these options.