firelinks 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ *.swp
2
+ pkg/
@@ -0,0 +1,71 @@
1
+ # Firelinks
2
+
3
+ Firelinks lets you mirror your Firefox browsing session in elinks.
4
+
5
+ [screenshots]
6
+
7
+ Benefits:
8
+
9
+ * Use Firefox's graphical interface to navigate the web visually
10
+ * Use elinks' austere textual interface to read content with more concentration and less distraction
11
+ * Save plain text versions of webpages with elinks' "Save formatted document" command
12
+
13
+
14
+ ## Prerequisites
15
+
16
+ * [elinks][elinks]
17
+ * Firefox 3 or higher
18
+ * Ruby (tested on 1.9.2)
19
+
20
+ [elinks]:http://elinks.or.cz/
21
+
22
+ ## Install
23
+
24
+ gem install firelinks
25
+
26
+ Try running it by typing `firelinks` on the command line. fIf you get an error
27
+ message saying that `firelinks` is missing, then you probably have a `PATH`
28
+ issue. Try one of these workarounds:
29
+
30
+ * Try installing with `sudo gem install firelinks`
31
+ * Put the directory where Rubygems installs executables on your `PATH`
32
+
33
+ To upgrade `firelinks` to a newer version, just repeat the installation procedure.
34
+
35
+ ## How to use it
36
+
37
+ Start Firefox. Then start Firelinks by opening a terminal and typing
38
+
39
+ firelinks
40
+
41
+ Firelinks starts Ruby process in your Terminal window, which in turn starts and
42
+ manages an `elinks` session that displays the current webpage.
43
+
44
+ As you visit pages in Firefox, you should see them should be loaded
45
+ automatically in the elinks session.
46
+
47
+ To quit Firelinks, just press `CTRL-C` (instead of the normal quit key sequence for elinks).
48
+
49
+
50
+
51
+ ## Bug reports and feature requests
52
+
53
+ Please submit these at either of these places:
54
+
55
+ * <https://github.com/danchoi/firelinks/issues>
56
+
57
+
58
+ ## About the developer
59
+
60
+ My name is Daniel Choi. I specialize in Ruby, Rails, MySQL, PostgreSQL, and iOS
61
+ development. I am based in Cambridge, Massachusetts, USA, and the little
62
+ software company I run with Hoony Youn is called [Kaja Software](http://kajasoftware.com).
63
+
64
+ * Company Email: info@kajasoftware.com
65
+ * Twitter: [@danchoi][twitter]
66
+ * Personal Email: dhchoi@gmail.com
67
+ * My Homepage: <http://danielchoi.com/software>
68
+
69
+ [twitter]:http://twitter.com/#!/danchoi
70
+
71
+
@@ -0,0 +1,56 @@
1
+ require 'rake'
2
+ require 'rake/testtask'
3
+ require 'bundler'
4
+ Bundler::GemHelper.install_tasks
5
+
6
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), 'lib')
7
+
8
+ desc "release and build and push new website"
9
+ task :push => [:release, :web]
10
+
11
+ desc "Bumps version number up one and git commits"
12
+ task :bump do
13
+ basefile = "lib/firelinks/version.rb"
14
+ file = File.read(basefile)
15
+ oldver = file[/VERSION = '(\d.\d.\d)'/, 1]
16
+ newver_i = oldver.gsub(".", '').to_i + 1
17
+ newver = ("%.3d" % newver_i).split(//).join('.')
18
+ puts oldver
19
+ puts newver
20
+ puts "Bumping version: #{oldver} => #{newver}"
21
+ newfile = file.gsub("VERSION = '#{oldver}'", "VERSION = '#{newver}'")
22
+ File.open(basefile, 'w') {|f| f.write newfile}
23
+ `git commit -am 'Bump'`
24
+ end
25
+
26
+ desc "build and push website"
27
+ task :web => :build_webpage do
28
+ puts "Building and pushing website"
29
+ Dir.chdir "../project-webpages" do
30
+ `scp out/firelinks.html zoe2@instantwatcher.com:~/danielchoi.com/public/software/`
31
+ #`rsync -avz out/images-firelinks zoe2@instantwatcher.com:~/danielchoi.com/public/software/`
32
+ #`rsync -avz out/stylesheets zoe2@instantwatcher.com:~/danielchoi.com/public/software/`
33
+ #`rsync -avz out/lightbox2 zoe2@instantwatcher.com:~/danielchoi.com/public/software/`
34
+ end
35
+ #`open http://danielchoi.com/software/firelinks.html`
36
+ end
37
+
38
+ desc "build webpage"
39
+ task :build_webpage do
40
+ `cp README.markdown ../project-webpages/src/firelinks.README.markdown`
41
+ #`cp coverage.markdown ../project-webpages/src/firelinks.coverage.markdown`
42
+ Dir.chdir "../project-webpages" do
43
+ puts `ruby gen.rb firelinks #{Firelinks::VERSION}`
44
+ `open out/firelinks.html`
45
+ end
46
+ end
47
+
48
+
49
+ desc "git push and rake release bumped version"
50
+ task :bumped do
51
+ puts `git push && rake release`
52
+ Rake::Task["web"].execute
53
+ end
54
+
55
+ task :default => :web
56
+
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ require 'firelinks'
4
+ rescue LoadError
5
+ require 'rubygems'
6
+ require 'firelinks'
7
+ end
8
+
@@ -0,0 +1,25 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "firelinks/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "firelinks"
7
+ s.version = Firelinks::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.required_ruby_version = '>= 1.8.6'
10
+
11
+ s.authors = ["Daniel Choi"]
12
+ s.email = ["dhchoi@gmail.com"]
13
+ s.homepage = "http://danielchoi.com/software/firelinks.html"
14
+ s.summary = %q{Mirror Firefox in elinks}
15
+ s.description = %q{Mirror Firefox in elinks}
16
+
17
+ s.rubyforge_project = "firelinks"
18
+
19
+ s.files = `git ls-files`.split("\n")
20
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
22
+ s.require_paths = ["lib"]
23
+
24
+ end
25
+
@@ -0,0 +1,45 @@
1
+
2
+
3
+ puts "Starting firelinks"
4
+ puts "Press CTRL-C to stop"
5
+ sleep 1
6
+
7
+
8
+
9
+ if `which elinks` !~ /\w/
10
+ abort "Missing elinks! Please install it."
11
+ end
12
+
13
+ history_path = `find #{ENV['HOME']}/.mozilla/firefox -name places.sqlite`.chomp
14
+
15
+ if history_path == ''
16
+ abort "You're missing your Firefox browser history database. Are you sure you have a recent version of Firefox installed?"
17
+ end
18
+
19
+ command = %Q{sqlite3 -line #{history_path} 'select url, title, last_visit_date from moz_places order by last_visit_date desc limit 2'}
20
+
21
+ use_remote = nil
22
+
23
+ url = nil
24
+
25
+ trap("INT") {
26
+ puts "Goodbye"
27
+ exit
28
+ }
29
+
30
+ loop do
31
+ res = %x{ #{command} }
32
+ current_url = res[/^\s+url = (.*)/, 1]
33
+ if current_url != url
34
+ url = current_url
35
+ cmd = if use_remote
36
+ %Q|elinks -remote 'openURL("#{url}")'|
37
+ else
38
+ "elinks '#{url}'"
39
+ end
40
+ use_remote ||= true
41
+
42
+ spawn(cmd)
43
+ end
44
+ sleep 0.5
45
+ end
@@ -0,0 +1,3 @@
1
+ module Firelinks
2
+ VERSION = '0.0.2'
3
+ end
Binary file
Binary file
Binary file
metadata ADDED
@@ -0,0 +1,58 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: firelinks
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Daniel Choi
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-07-26 00:00:00.000000000 -04:00
13
+ default_executable:
14
+ dependencies: []
15
+ description: Mirror Firefox in elinks
16
+ email:
17
+ - dhchoi@gmail.com
18
+ executables:
19
+ - firelinks
20
+ extensions: []
21
+ extra_rdoc_files: []
22
+ files:
23
+ - .gitignore
24
+ - README.markdown
25
+ - Rakefile
26
+ - bin/firelinks
27
+ - firelinks.gemspec
28
+ - lib/firelinks.rb
29
+ - lib/firelinks/version.rb
30
+ - screens/firelinks1.png
31
+ - screens/firelinks1b.png
32
+ - screens/firelinks1c.png
33
+ has_rdoc: true
34
+ homepage: http://danielchoi.com/software/firelinks.html
35
+ licenses: []
36
+ post_install_message:
37
+ rdoc_options: []
38
+ require_paths:
39
+ - lib
40
+ required_ruby_version: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 1.8.6
46
+ required_rubygems_version: !ruby/object:Gem::Requirement
47
+ none: false
48
+ requirements:
49
+ - - ! '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ requirements: []
53
+ rubyforge_project: firelinks
54
+ rubygems_version: 1.6.2
55
+ signing_key:
56
+ specification_version: 3
57
+ summary: Mirror Firefox in elinks
58
+ test_files: []