pinboard-elinks

Check-in [90f82277b0]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Change keybindings to suit my environment (Alt bindings conflict with dwm)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256: 90f82277b08784ab49874ffe5f72c07bb1ab14e7d1350870d258e2e9bd466e1a
User & Date: atomicules@lavabit.com 2013-05-27 14:41:45
Context
2013-05-27
14:41
Temp fix for off by one error. Note from the Lua manual for string.byte and string.char: "Note that numerical codes are not necessarily portable across platforms." The original worked fine for me on OSX PPC, but on i386 NetBSD it's off by one. Could do with a better fix (I.e understanding it, rather than just sticking in the -1) check-in: ba3a1fc143 user: atomicules@lavabit.com tags: master, trunk
14:41
Change keybindings to suit my environment (Alt bindings conflict with dwm) check-in: 90f82277b0 user: atomicules@lavabit.com tags: master, trunk
2012-12-29
12:06
Make sure everything is local ref. check-in: e662f63e44 user: atomicules@lavabit.com tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pinboard.lua.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
..
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--Pinboard tools for ELinks
--source from your ~/.elinks/hooks.lua file with `dofile("pinboard.lua")`

--ALT+p to save a bookmark. Brings up an XDialog, first row is to enter a description, second row is for tags
--ALT+l to read later. 
--Reformats the mobile site to be better for ELinks

--In order to be able to delete need to enter auth_token in `.netrc`. See README
local pb_base = 'https://pinboard.in/add?'
local pb_url

function addto_pinboard (description, tags)
	local url = current_url ()
	local title = current_title ()
	local doc_url = pb_base..'url='..escape (url)..'&title='..escape (title)..'&description='..escape (description)..'&tags='..escape (tags)..'&next='..escape (url)..' ','Pinboard','toolbar=no,width=700,height=350';
    return doc_url
end
	bind_key ("main", "Alt-p",
		function () xdialog("<Description>", "<Tags>",
			function (description, tags)
				return "goto_url",
				addto_pinboard (description, tags) 
		end)
	end)

................................................................................
function readlater_pinboard ()
	local url = current_url ()
	local title = current_title ()
	local doc_url = pb_base..'later=yes&next=same&noui=yes&jump=close&url='..escape (url)..'&title='..escape (title)..' ','Pinboard','toolbar=no,width=100,height=100';
	--Uses &next=same to immediately return to page being bookmarked
    return doc_url
end
	bind_key ("main", "Alt-l",
		function () return "goto_url", readlater_pinboard () end)


function pre_format_html_hook (url, html)
	--strip stuff that shouldnae be displayed anyway
	if string.find(url, "://m.pinboard.in") then
		pb_url = url --since can't pass additional args to new_edit_link



|
|












|







 







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
..
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--Pinboard tools for ELinks
--source from your ~/.elinks/hooks.lua file with `dofile("pinboard.lua")`

--CTRL+p to save a bookmark. Brings up an XDialog, first row is to enter a description, second row is for tags
--CTRL+l to read later. 
--Reformats the mobile site to be better for ELinks

--In order to be able to delete need to enter auth_token in `.netrc`. See README
local pb_base = 'https://pinboard.in/add?'
local pb_url

function addto_pinboard (description, tags)
	local url = current_url ()
	local title = current_title ()
	local doc_url = pb_base..'url='..escape (url)..'&title='..escape (title)..'&description='..escape (description)..'&tags='..escape (tags)..'&next='..escape (url)..' ','Pinboard','toolbar=no,width=700,height=350';
    return doc_url
end
	bind_key ("main", "Ctrl-p",
		function () xdialog("<Description>", "<Tags>",
			function (description, tags)
				return "goto_url",
				addto_pinboard (description, tags) 
		end)
	end)

................................................................................
function readlater_pinboard ()
	local url = current_url ()
	local title = current_title ()
	local doc_url = pb_base..'later=yes&next=same&noui=yes&jump=close&url='..escape (url)..'&title='..escape (title)..' ','Pinboard','toolbar=no,width=100,height=100';
	--Uses &next=same to immediately return to page being bookmarked
    return doc_url
end
	bind_key ("main", "Ctrl-l",
		function () return "goto_url", readlater_pinboard () end)


function pre_format_html_hook (url, html)
	--strip stuff that shouldnae be displayed anyway
	if string.find(url, "://m.pinboard.in") then
		pb_url = url --since can't pass additional args to new_edit_link