You are not logged in.
Hi.
I wrote a short Ruby script for sending files to your phone, which should be in the same network with your computer.
The script simply runs a simple web server, and generates a barcode pointing to the computer's IP and applications port. And you just point your phone to the barcode generated and your phone starts downloading using its web browser.
With this way, I could stream HD videos without any delay.
It's also my first Ruby code, I'll happily accept suggestions.
Offline
doesnt work with escaped filenames:
./qrpush.rb:47:in `escape_filename': undefined local variable or method `fnamex' for main:Object (NameError)
from ./qrpush.rb:90:in `<main>'
Also does not detect my IP:
1 carnager@caprica ~/qrpush (git)-[master] % ./qrpush.rb ~/20130730125833.webm
Url: http://:9090/20130730125833.webm
Last edited by Rasi (2013-08-08 16:48:26)
He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.
Douglas Adams
Offline
doesnt work with escaped filenames:
./qrpush.rb:47:in `escape_filename': undefined local variable or method `fnamex' for main:Object (NameError) from ./qrpush.rb:90:in `<main>'
Sorry, typo on my side, fixed.
Also does not detect my IP:
1 carnager@caprica ~/qrpush (git)-[master] % ./qrpush.rb ~/20130730125833.webm Url: http://:9090/20130730125833.webm
Don't know why, getting IP address was pretty simple:
def get_ip_addresses
locals = %w(127.0.0.1 ::1)
addresses = Socket.ip_address_list.select{|a| a.ipv4?}
addresses.map!{|a| a.ip_address}
addresses.select!{|a| not locals.include? a}
addresses
end
Can you post the output of command
ruby -e "require 'socket'" -e "p Socket.ip_address_list"
Offline
[#<Addrinfo: 127.0.0.1>, #<Addrinfo: 192.168.1.13>, #<Addrinfo: ::1>, #<Addrinfo: fe80::22cf:30ff:fe23:c132%eth0>]
have you pushed the fix? git says its up to date.
Last edited by Rasi (2013-08-08 20:44:20)
He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.
Douglas Adams
Offline
Fixed both bugs, thank you for reporting . (And also pushed)
Last edited by utdemir (2013-08-08 21:01:02)
Offline
working fine now. nice little tool
He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.
Douglas Adams
Offline
I've never used ruby before so I'm probably missing something obvious, but what does this mean
$ ./qrpush.rb ~/music/morrissey/morrissey_20130119_port-chester-ny/Moz\ 20130119\ 01\ That\ Joke\ Isn\'t\ Funny\ Anymore.flac
/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- rqrcode (LoadError)
from /usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from ./qrpush.rb:3:in `<main>'
Offline
Hi oliver, thanks for trying .
You can install all dependencies after installing bundler. First, install bundle with either with "gem install bundler" or ruby-bundler package from AUR. After that give,
bundle install
command on projects directory(where Gemfile is). This should install all dependencies("rqrcode" and "ruby-filemagic").
Offline
thanks! I went the AUR way and it's all working well now.
Offline
Works great! Thanks!
Offline