What's new

Tutorial How to install Gyazo on Ubuntu

  • Thread starter Laugh
  • Start date
  • Views 2,264
Laugh

Laugh

Contributor
5th Anniversary Chatty Kathy Jokester
Messages
2,971
Reaction score
518
Points
345
Sin$
0
Gyazo is a screenshot-taker that takes a screenshot of a custom area. It is only made for Windows, but can be coded for Ubuntu to. Here is what you do:

1. Install Imagemagick in the Software Center
4f765aed0f8b6e0e1e12bdeaff273443.png


2. Open the Terminal and type "sudo apt-get install ruby" without the quotes. Let it install.
af0021fa7fb51982a97f2e26c0ab5d75.png


3. Now open gedit and paste this code in:
Code:
#!/usr/bin/env ruby 

# setting 
browser_cmd = 'firefox' 
clipboard_cmd = 'xclip' 
proxy_addr = nil 
proxy_port = nil 

require 'net/http' 

# get id 
idfile = ENV['HOME'] + "/.gyazo.id" 

id = '' 
if File.exist?(idfile) then 
id = File.read(idfile).chomp 
end 

# capture png file 
tmpfile = "/tmp/image_upload#{$$}.png" 
imagefile = ARGV[0] 

if imagefile && File.exist?(imagefile) then 
system "convert #{imagefile} #{tmpfile}" 
else 
system "import #{tmpfile}" 
end 

if !File.exist?(tmpfile) then 
exit 
end 

imagedata = File.read(tmpfile) 
File.delete(tmpfile) 

# upload 
boundary = '----BOUNDARYBOUNDARY----' 

HOST = 'gyazo.com' 
CGI = '/upload.cgi' 
UA   = 'Gyazo/1.0' 

data = <<EOF 
--#{boundary}\r 
content-disposition: form-data; name="id"\r 
\r 
#{id}\r 
--#{boundary}\r 
content-disposition: form-data; name="imagedata"; filename="gyazo.com"\r 
\r 
#{imagedata}\r 
--#{boundary}--\r 
EOF 

header ={ 
'Content-Length' => data.length.to_s, 
'Content-type' => "multipart/form-data; boundary=#{boundary}", 
'User-Agent' => UA 
} 

Net::HTTP::Proxy(proxy_addr, proxy_port).start(HOST,80) {|http| 
res = http.post(CGI,data,header) 
url = res.response.to_ary[1] 
puts url 
if system "which #{clipboard_cmd} >/dev/null 2>&1" then 
system "echo -n #{url} | #{clipboard_cmd}" 
end 
system "#{browser_cmd} #{url}" 

# save id 
newid = res.response['X-Gyazo-Id'] 
if newid and newid != "" then 
if !File.exist?(File.dirname(idfile)) then 
Dir.mkdir(File.dirname(idfile)) 
end 
if File.exist?(idfile) then 
File.rename(idfile, idfile+Time.new.strftime("_%Y%m%d%H%M%S.bak")) 
end 
File.open(idfile,"w").print(newid) 
end 
}
The line that says browser_cmd = 'firefox' will open Firefox so if you want it to open Chromium instead replace it with browser_cmd = 'chromium-browser'

Now save it as gyazo.rb

4. Right-click gyazo.rb and click Properties. And under Permissions check the Execution box.
2fb838e2ce670c13eb3a1919bafa56b4.png


5. Drag it to your navbar on the top and when you want to take a picture just click it!
0f8baa6fc1dea52ddd55a2a82f294c03.png


Enjoy!
 
Operating System
  1. Linux
Rally

Rally

Experienced Member
Mythical Veteran Tutorial Creator Fabled Veteran
Messages
6,769
Reaction score
3,318
Points
735
Sin$
7
ubuntu/linux has a screen cap program pre installed lol and i find it better lol but nice tut :biggrin:
 
Laugh

Laugh

Contributor
5th Anniversary Chatty Kathy Jokester
Messages
2,971
Reaction score
518
Points
345
Sin$
0
It has print screen "pre-installed" and I found Gyazo more useful.
 
Laugh

Laugh

Contributor
5th Anniversary Chatty Kathy Jokester
Messages
2,971
Reaction score
518
Points
345
Sin$
0
Bump, also made it on search engines lol:
http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=how+to+install+gyazo+on+ubuntu
 
S

stechmagnet

Newbie
Messages
20
Reaction score
1
Points
45
Sin$
0
I actually find less of a need for a screenshot program in Linux lol. With the print screen method you don't even have to copy the image into paint or photoshop, it will give you a window with options to save it right away.
Unless you want to edit the image afterwards, then there may be a problem, but if they had a function that would allow you to do some cropping and box creating from the print screen button, that would be genius...

thanks....

sony bdp-s570
Zune HD
 
Laugh

Laugh

Contributor
5th Anniversary Chatty Kathy Jokester
Messages
2,971
Reaction score
518
Points
345
Sin$
0
Yeah, I like that too but sometimes it is quicker to use Gyazo.
 
Laugh

Laugh

Contributor
5th Anniversary Chatty Kathy Jokester
Messages
2,971
Reaction score
518
Points
345
Sin$
0
Bump since it just got moved and all the posts got deleted -___-
 
Top Bottom
Login
Register