Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added 2 new utils

  • Loading branch information...
commit 69d3255824d701e1971a1052c03f1fae92a7ad85 1 parent ce3af02
@amit authored
Showing with 42 additions and 0 deletions.
  1. +16 −0 get_lattitude.rb
  2. +26 −0 mp3len.rb
16 get_lattitude.rb
@@ -0,0 +1,16 @@
+#!/bin/env ruby
+# Simple ruby script to get lattitude and longitude of any place
+# Specify the address in a line with any level of detail
+# It also shows ZIP+4 for a given street address
+require 'open-uri'
+require "rexml/document"
+include REXML
+puts 'Enter Location: '
+doc = result
+print "Precision: ", r.attributes["precision"],"\n"
+r.children.each { |c| print, " : ",c.text,"\n"}
26 mp3len.rb
@@ -0,0 +1,26 @@
+#!/usr/bin/env ruby
+# A script to sort a list of mp3 files sorted by the duration of the audio file
+# Needs the gem ruby-mp3info
+# gem install ruby-mp3info
+require "rubygems"
+require 'mp3info'
+def mp3len(dirname)
+Dir[dirname].each do |f| do |info|
+puts "Enter directory containing mp3 files"
+dirname = File.expand_path(dirname)
+puts "Searching #{dirname}"
+dirname += "/**/*.mp3"
+s=mp3len(dirname).sort {|a,b| a[1] <=> b[1]}
+s.each{|q| puts "#{q[0]} => #{q[1]} seconds"}
Please sign in to comment.
Something went wrong with that request. Please try again.