<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/18099" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2010-10-30T11:23:57-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/18099</id>

		<entry>
		<author><name><![CDATA[Razor]]></name></author>
		<updated>2010-10-30T11:23:57-04:00</updated>

		<published>2010-10-30T11:23:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94920#p94920</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94920#p94920"/>
		<title type="html"><![CDATA[Freshmeat/Sourceforge lookup/search script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94920#p94920"><![CDATA[
Heya,<br><br>I came across this script by domsen called freshmeat(1.2.tcl). The script seem to work, the only thing is that it does not output the "$newsline" accordingly, ok.. ok.. it doesn't work..<br><br>Example:<blockquote class="uncited"><div>[ Razor ]: !freshmeat Joomla<br>[ BitchyBot ]: - <a href="http://freshmeat.net" class="postlink">http://freshmeat.net</a>  <br>[ BitchyBot ]: - <a href="http://freshmeat.net" class="postlink">http://freshmeat.net</a>  <br>[ BitchyBot ]: - <a href="http://freshmeat.net" class="postlink">http://freshmeat.net</a>  <br>[ BitchyBot ]: - <a href="http://freshmeat.net" class="postlink">http://freshmeat.net</a>  <br>[ BitchyBot ]: - <a href="http://freshmeat.net" class="postlink">http://freshmeat.net</a>  </div></blockquote>The above shows the output after a 'freshmeattrigger' and 'freshmeatsearchtrigger' command is executed in 'freshmeatchans'.<br><br>I've try'd it on an eggdrop1.6.20 with egghttp.tcl installed.<br><br>Also, will it be possible to have a SourceForge.net lookup/search aswell? I think that would be a handy one, especially for those Computer Geeks ;P  - Hope I'm not asking too much.<br><br>Besides this script, can <a href="http://forum.egghelp.org/viewtopic.php?t=16856" class="postlink">http://forum.egghelp.org/viewtopic.php?t=16856</a> be converted to a Freshmeat and Sourceforge lookup/search script?<br><br>Would appreciate the kind help, thank you.<br><br><br><div class="codebox"><p>Code: </p><pre><code>set freshmeattrigger "!freshmeat"set freshmeatsearchtrigger "!fms"set freshmeatchans "#razor-bots #ubuntu"set freshmeatlimit "5"set freshmeatnewspostlimit "3"set freshmeatnewspost "1"set isfreshmeathub "0"set freshmeatleafs ""# Auto get new news.set freshmeat(autonews) "1"# update delay (minimal 5)set freshmeat(updates) "5"####### ende der config #############bind msg - $freshmeattrigger msg_freshmeatbind pub - $freshmeattrigger pub_freshmeatbind msg - $freshmeatsearchtrigger msg_freshmeatsearchbind pub - $freshmeatsearchtrigger pub_freshmeatsearch#bind time - "*0,*5 * * * *" freshmeatcheckproc sendfreshmeatnews { arg } {global freshmeatleafsforeach bot [bots] {if {([lsearch -exact [string tolower $freshmeatleafs] [string tolower $bot]] != -1)} {putbot $bot "freshmeat: $arg"}}}proc shrink { calc number string start bl} { return [expr [string first "$string" $bl $start] $calc $number] }proc freshmeatsearch { target limit arg } {if {$arg == ""} { return 0}putlog "freshmeat: search by $target for ($arg)"regsub " " $arg "%20" argif {[catch {set sock [socket freshmeat.net 80] } sockerror]} {putlog "error: $sockerror"return 0 } else {puts $sock "GET /search/?q=$arg&amp;section=projects HTTP/1.1"puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"puts $sock "Host: freshmeat.net"puts $sock "Connection: close"puts $sock ""flush $sockset counter 0while {[eof $sock] != 1} {set bl [gets $sock]if {[string first "No matches" $bl] != -1 } {putserv "privmsg $target :no matches found";return 0 }if {[string first "Location: http://freshmeat.net/projects/" $bl] != -1 } {set newsline $argset link "www.freshmeat.net/[string range $bl 30 [string last "/" $bl]]"putserv "notice $target :$newsline -  $link"incr counter}if {[string first "href=\"/projects/" $bl] != -1} {set link "www.freshmeat.net/[string range $bl [shrink + 8 " href=\"" 0 $bl] [shrink - 1 "/\"&gt;" 0 $bl]]"set newsline [string range $bl [shrink + 3 "&lt;b&gt;" 0 $bl] [shrink - 1 "&lt;/b&gt;" 0 $bl]]regsub -all "&lt;b style=\"background: #FFFF00\"&gt;" $newsline "" newslineputserv "notice $target :$newsline -  $link"incr counter}if {$counter == $limit} {close $sock; return 0}}}}proc freshmeatnews { target limit } {if {[catch {set sock [socket freshmeat.net 80] } sockerror]} {putlog "error: $sockerror"return 0 } else {puts $sock "GET / HTTP/1.1"puts $sock "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"puts $sock "Host: freshmeat.net"puts $sock "Connection: close"puts $sock ""flush $sockset counter 0while {[eof $sock] != 1} {set bl [gets $sock]if {[string first "Tired of seeing a" $bl] != -1} { return 0 }if {[string first "/projects/" $bl] != -1 &amp;&amp; [string first "sourceforge.net" $bl] == -1} {set link "www.freshmeat.net/[string range $bl [shrink + 8 " href=\"" 0 $bl] [shrink - 1 "/\"&gt;" 0 $bl]]"set newsline [string range $bl [shrink + 9 "#000000\"&gt;" 0 $bl] [shrink - 1 "&lt;/font&gt;" 0 $bl]]putserv "notice $target :[incr counter] $newsline -  $link"}if {$counter == $limit} {close $sock; return 0}}}}proc freshmeatcheck {} {    global freshmeat freshmeatchans freshmeatnewspost isfreshmeathub freshmeatnewspostlimit    set counter 0    # Eggdrop timer to loop the checker    if {$freshmeat(updates) &lt; 5} {        putlog "\[Freshmeat!\] Warning: the \$freshmeat(updates) setting is too low! Defaulting to 5 minutes..."        timer 5 freshmeatcheck    } else {        timer $freshmeat(updates) freshmeatcheck    }    if {$freshmeatnewspost == 1 } {putlog "\[Freshmeat!\]: search for new news lines"set freshmeatlastnews "none"if {[file exists freshmeat.hdl]} {    set temp [open "freshmeat.hdl" r]    set freshmeatlastnews "[gets $temp]"    if {$freshmeatlastnews == ""} { set freshmeatlastnews "none" }    close $temp}set temp [open "freshmeat.hdl" w+]if {[catch {set sock [socket freshmeat.net 80] } sockerror]} {    putlog "error: $sockerror"    return 0} else {    puts $sock "GET / HTTP/1.1"    puts $sock "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"    puts $sock "Host: freshmeat.net"    puts $sock "Connection: close"    puts $sock ""    flush $sock    set checker 0    while {[eof $sock] != 1 &amp;&amp; $checker == 0} {set bl [gets $sock]        if {[string first "Tired of seeing a" $bl] != -1} { set checker 1 }if {[string first "/projects/" $bl] != -1 &amp;&amp; [string first "sourceforge.net" $bl] == -1} {    set link "www.freshmeat.net/[string range $bl [shrink + 8 " href=\"" 0 $bl] [shrink - 1 "/\"&gt;" 0 $bl]]"    set newsline [string range $bl [shrink + 9 "#000000\"&gt;" 0 $bl] [shrink - 1 "&lt;/font&gt;" 0 $bl]]    puts $temp "$newsline -  $link"}    }}close $sock ; close $tempif {$freshmeatlastnews == "none" } { putlog "freshmeat: headlinefile created" ; return 0 }set temp [open "freshmeat.hdl" r]while { [eof $temp] != 1 } {    set freshmeatneunews [gets $temp]    if {($freshmeatlastnews == $freshmeatneunews) || ($counter == $freshmeatnewspostlimit)} { close $temp;return 0 }    incr counter    if { $isfreshmeathub == "1" } { sendfreshmeatnews $freshmeatneunews }    foreach chan [channels] {if {$freshmeatchans == "" } { putserv "privmsg $chan :\[\002Freshmeat.net\002\] $freshmeatneunews" }    if {$freshmeatchans != "" } {if {([lsearch -exact [string tolower $freshmeatchans] [string tolower $chan]] != -1) || ($freshmeatchans == "")} {putserv "privmsg $chan :\[\002Freshmeat.net\002\] $freshmeatneunews"}    }    }}    }}set fmeat_timer [timerexists "freshmeatcheck"]if {$fmeat_timer != ""} { killtimer $fmeat_timer }catch { unset fmeat_timer }if {$freshmeat(autonews) == 1} { freshmeatcheck }proc msg_freshmeat { nick uhost hand arg } { global freshmeatlimit ; freshmeatnews $nick $freshmeatlimit }proc pub_freshmeat { nick uhost hand chan arg } { global freshmeatchans freshmeatlimit ; if {([lsearch -exact [string tolower $freshmeatchans] [string tolower $chan]] != -1) || ($freshmeatchans == "")} { freshmeatnews $nick $freshmeatlimit }}proc msg_freshmeatsearch { nick uhost hand arg } { global freshmeatlimit ; freshmeatsearch $nick $freshmeatlimit $arg}proc pub_freshmeatsearch { nick uhost hand chan arg } { global freshmeatchans freshmeatlimit ; if {([lsearch -exact [string tolower $freshmeatchans] [string tolower $chan]] != -1) || ($freshmeatchans == "")} { freshmeatsearch $nick $freshmeatlimit $arg }}#[EOF]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10960">Razor</a> — Sat Oct 30, 2010 11:23 am</p><hr />
]]></content>
	</entry>
	</feed>
