watir_使用Watir的非常穷人的Vonage Web服务

watir

watir

Folks keep calling after 9pm and waking the baby. We use Vonage, and I really wish they had a feature where I could indicate "do not call" times. Alas, they don't. So, then I wished for a Vonage Web Service. Nope.

晚上9点以后,人们会继续打电话给婴儿。 我们使用Vonage ,我真的希望他们有一个可以指示“不打电话”时间的功能。 las,他们没有。 因此,我当时希望获得Vonage Web服务。 不。

So, instead here's a Watir script, recorded with a early version of Michael Kelly and John Hann's port of WatirMaker to Ruby (via "ruby watirmaker.rb > myscript.rb") then edited to taste.

因此,这是一个Watir脚本,记录了迈克尔·凯利( Michael Kelly)和约翰·汉恩(John Hann)的WatirMaker到Ruby的早期版本(通过“ ruby​​ watirmaker.rb> myscript.rb”),然后进行编辑以进行品尝。

#Enable Instant Forward to Voice Mail
require 'watir'
include Watir

#启用即时转发到语音邮件需要“ watir” 包括瓦蒂尔

ie = IE.new
ie.goto( 'http://www.vonage.com/' )

即= IE.new ie.goto('http://www.vonage.com/')

ie.text_field( :name, 'username' ).set( 'username' )
ie.text_field( :name, 'password' ).set( 'password' )
ie.button( :name, 'submit' ).click

ie.text_field(:name,'username').set('username') ie.text_field(:name,'password').set('password') ie.button(:name,'submit').click

ie.link(:text,"Features").click

ie.link(:text,“ Features”)。click

ie.button( :name, 'callForwardingButton' ).click

ie.button(:name,'callForwardingButton').click

ie.select_list( :name, 'callForwardingSeconds' ).select( 'Instantly' )
ie.text_field( :name, 'singleAddress' ).set( '15035551234' )

ie.select_list(:name,'callForwardingSeconds').select('Instantly') ie.text_field(:name,'singleAddress').set('15035551234')

ie.button(:value,'Enable').click

ie.button(:value,'Enable')。click

ie.link(:text,"Log Out").click
ie.close

ie.link(:text,“登出”).click 即关闭

And the disable...

还有禁用...

require 'watir'
include Watir

需要“ watir” 包括瓦蒂尔

ie = IE.new
ie.goto( 'http://www.vonage.com/' )

即= IE.new ie.goto('http://www.vonage.com/')

ie.text_field( :name, 'username' ).set( 'username')
ie.text_field( :name, 'password' ).set( 'password' )
ie.button( :name, 'submit' ).click

ie.text_field(:name,'username')。set('username') ie.text_field(:name,'password').set('password') ie.button(:name,'submit').click

ie.link(:text,"Features").click

ie.link(:text,“ Features”)。click

ie.button( :name, 'callForwardingButton' ).click

ie.button(:name,'callForwardingButton').click

ie.button(:value,'Disable').click

ie.button(:value,'Disable')。click

ie.link(:text,"Log Out").click
ie.close

ie.link(:text,“登出”).click 即关闭

These now run on a schedule in my house using the Windows Scheduler. If you run them like 'ruby enable.rb -b' they run in the background and you'll never see Internet Explorer.

现在,这些命令将使用Windows Scheduler在我家的日程表上运行。 如果您像“ ruby​​ enable.rb -b ”一样运行它们,它们将在后台运行,并且您将永远不会看到Internet Explorer。

翻译自: https://www.hanselman.com/blog/a-very-poor-mans-vonage-web-service-using-watir

watir

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值