File: url.irc

package info (click to toggle)
epic5 3.0.3-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 5,328 kB
  • sloc: ansic: 75,810; makefile: 648; ruby: 227; python: 215; sh: 78; perl: 13
file content (47 lines) | stat: -rw-r--r-- 1,115 bytes parent folder | download | duplicates (5)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
on ^public * {
	@words = []
	fe ($2-) aa {
		if (match(*www.* $aa) == 1) {
			push words $cparse($chr(31)%b$aa$chr(31))
			@ z = 1
		} else if (match(*ftp.* $aa) == 1) {
			push words $cparse($chr(31)%b$aa$chr(31))
			@ z = 1
		} else if (match(*://* $aa) == 1) {
			push words $cparse($chr(31)%b$aa$chr(31))
			@ z = 1
		} else {
			push words $aa
		}
		if (z == 1) {
			for (@i = 9, i != 0, @i--) {
				@url[$i] = url[${i - 1}]
				@urlnick[$i] = urlnick[${i - 1}]
				@urlchan[$i] = urlchan[${i - 1}]
				@urltime[$i] = urltime[${i - 1}]
			}
			@url[0] = aa
			@urlnick[0] = [$0]
			@urlchan[0] = [$1]
			@ z = 0
		}
	}
	xecho -w $winchan($1) <$0> $words
}

alias pages (arg) {

	if (arg == []) {
		exec /usr/local/firefox/firefox -remote "openURL\($url[0],new-tab\)"
	} else if (isnumber($arg) && (arg != 0) && (arg < 11)) {
		exec /usr/local/firefox/firefox -remote "openURL\($url[${arg - 1}],new-tab\)"		
	} else {
		echo 
		echo Last 10 Captured URLS...
		for (@:i = 9, i >= 0, @i--) {
			if (url[$i] != []) {
				echo ${i + 1}. $urlchan[$i]:<$urlnick[$i]> $cparse($chr(31)%b$url[$i]$chr(31))
			}
		}
	}
}