[script] Eggdrop RSS Syndication
(26/08/2011, 14:27)aliasangelius a écrit : Bonjour,

Voilà suite à une discutions avec MenzAgitat j'ai voulus avoir son système de tinyurl pour ceux qui ne Save pas ce que c'est :

Tinyurl et le raccourcissement d'url exemple :

Citation :( @Talk-Me ) [ Deux-Sèvres ] Pourquoi pas la chèvre pour nous identifier ? [http://www.lanouvellerepublique.fr/ACTUA...identifier]

Donc ceci et ce que ont obtient lorsqu'on à le TCL rss-synd.. À la base.
Ensuite lorsque nous mettons la procédure de tinyurl ça donne ceci :

Citation :( @Talk-Me ) [ Deux-Sèvres ] Vacances pour agriculteurs : moins rares, plus chères [http://tinyurl.com/3jhz92v]

Donc le système de procédure de tinyurl ma été donnais par MenzAgitat qui ma tout de même demander de préciser une chose :

La proc tinyurl vient du script TkTiny de Tomekk.

Maintenant ont va expliquer ou mettre cette procédure et aussi la donnais serait pas mal Smile.

Voici la procédure :

tcl
proc ::rss-synd::grab_data { url } {
  set get_url_timeout "10"
	set uagent "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2"
  set url [string map -nocase {
	  "&"		"&"
  } $url]
	set tiny_query "http://tinyurl.com/create.php?[::http::formatQuery url ${url}]"
	set tiny_token [http::config -useragent $uagent]
	set tiny_token [http::geturl $tiny_query -timeout [expr $get_url_timeout * 1000]]
	set html_data [http::data $tiny_token]
	::http::cleanup $tiny_token
	set all_n [split $html_data \n]
  set tiny_link ""
	foreach tiny_lines $all_n {
		if {[regexp -all -nocase "<blockquote>(.*)</b><br>(.*)</blockquote>" $tiny_lines]} {
			regsub -all -nocase "<blockquote><b>" $tiny_lines "" tiny_link
			regsub -all -nocase "</b><br><small>(.*)</small></blockquote>" $tiny_link "" tiny_link
		}
	}
	if {($tiny_link != 0) && ($tiny_link ne "")} {
		return $tiny_link
	} {
		return "\00307(problème avec tinyurl.com)\00314 ${url}"
	}
}



Mettre la procédure dans le tcl.

Ensuite mettre ceci aussi :

tcl
if { ([string last "title" $cookie] == 25) || ([string last "title" $cookie] == 19) } {
				set tmp [encoding convertfrom utf-8 $tmp]
 			} elseif { ([string last "link" $cookie] == 25) || ([string last "link" $cookie] == 19) } {
				set tmp [::rss-synd::grab_data $tmp]
			}



Une fois ceci fait supprimer ce que vous avez dans le dossier "rss" ou sont stockait tout vos rss une fois le tout supprimé faite un rehash/restart de votre eggdrop.

Et lorsque votre eggdrop fera une annonce d'un flux rss il affichera avec tynurl !

PS : je ferais une version traduite en français avec un rss-synd.tcl
Qui bien sur sera avec le système de tynurl Smile.

Voila have fun =)

Bonjour,

Je suis très intéressé par ta procédure tinyurl.

Toutefois j'ai deux questions :

1. La "proc ::rss-synd::grab_data" on la mets n'importe où dans le script ?
2. Où mettre le "if" de la 2ème partie ? N'importe quel endroit ?
3. Quand tu parles de supprimer le dossier "rss" parles tu du dossier où sont stockés les fichiers ".db" des différents flux ? Car de mon côté je n'ai aucun dossier "rss".

Merci par avance de l'aide que tu pourras m'apporter.

@+
Répondre Avertir


Messages dans ce sujet
[script] Eggdrop RSS Syndication - par CrazyCat - 21/02/2008, 18:14
RE: Eggdrop RSS Syndication - par Piepierre - 21/02/2008, 18:23
RE: Eggdrop RSS Syndication - par CrazyCat - 21/02/2008, 18:28
RE: Eggdrop RSS Syndication - par MenzAgitat - 22/02/2008, 02:17
RE: Eggdrop RSS Syndication - par titinio - 15/05/2008, 09:26
RE: Eggdrop RSS Syndication - par CrazyCat - 15/05/2008, 13:30
RE: Eggdrop RSS Syndication - par tr3nk1l - 15/06/2008, 23:27
RE: Eggdrop RSS Syndication - par Helias - 16/06/2008, 02:00
RE: Eggdrop RSS Syndication - par knx - 11/07/2008, 21:44
RE: Eggdrop RSS Syndication - par lepheniX - 21/07/2008, 03:52
RE: Eggdrop RSS Syndication - par lepheniX - 22/07/2008, 13:40
RE: Eggdrop RSS Syndication - par BdS - 23/07/2008, 12:53
RE: Eggdrop RSS Syndication - par knx - 25/07/2008, 07:28
RE: Eggdrop RSS Syndication - par MenzAgitat - 28/07/2008, 02:27
RE: Eggdrop RSS Syndication - par MenzAgitat - 28/07/2008, 16:29
RE: Eggdrop RSS Syndication - par Rikito - 04/09/2008, 13:52
RE: Eggdrop RSS Syndication - par CrazyCat - 04/09/2008, 21:28
RE: Eggdrop RSS Syndication - par Rikito - 04/09/2008, 22:19
RE: Eggdrop RSS Syndication - par CrazyCat - 05/09/2008, 20:14
RE: Eggdrop RSS Syndication - par MenzAgitat - 05/09/2008, 01:18
RE: Eggdrop RSS Syndication - par Rikito - 05/09/2008, 19:59
RE: Eggdrop RSS Syndication - par kipof - 22/02/2009, 17:30
RE: Eggdrop RSS Syndication - par CrazyCat - 22/02/2009, 22:48
RE: Eggdrop RSS Syndication - par kipof - 22/02/2009, 23:37
RE: Eggdrop RSS Syndication - par CrazyCat - 23/02/2009, 10:24
RE: [script] Eggdrop RSS Syndication - par joh93 - 17/10/2009, 16:58
RE: [script] Eggdrop RSS Syndication - par Utas - 29/04/2010, 16:40
RE: [script] Eggdrop RSS Syndication - par Marc - 29/04/2010, 20:45
RE: [script] Eggdrop RSS Syndication - par Utas - 30/04/2010, 02:52
RE: [script] Eggdrop RSS Syndication - par nolaan - 06/06/2010, 10:39
RE: [script] Eggdrop RSS Syndication - par Xima - 29/08/2010, 17:45
RE: [script] Eggdrop RSS Syndication - par uto - 25/06/2011, 19:30
RE: [script] Eggdrop RSS Syndication - par Cain - 18/08/2011, 05:41
RE: [script] Eggdrop RSS Syndication - par Cain - 22/08/2011, 05:24
RE: [script] Eggdrop RSS Syndication - par conscience - 27/05/2013, 12:48
RE: [script] Eggdrop RSS Syndication - par Nosy - 21/12/2011, 08:53
RE: [script] Eggdrop RSS Syndication - par Nosy - 21/12/2011, 15:16
RE: [script] Eggdrop RSS Syndication - par Nosy - 21/12/2011, 16:32
RE: [script] Eggdrop RSS Syndication - par Nosy - 21/12/2011, 16:49
RE: [script] Eggdrop RSS Syndication - par Nosy - 21/12/2011, 17:08
RE: [script] Eggdrop RSS Syndication - par Nosy - 21/12/2011, 17:35
RE: [script] Eggdrop RSS Syndication - par Nosy - 21/12/2011, 17:49
RE: [script] Eggdrop RSS Syndication - par Nosy - 21/12/2011, 18:00
RE: [script] Eggdrop RSS Syndication - par Nosy - 21/12/2011, 18:28
RE: [script] Eggdrop RSS Syndication - par Nosy - 21/12/2011, 19:48
RE: [script] Eggdrop RSS Syndication - par Nosy - 21/12/2011, 20:21
RE: [script] Eggdrop RSS Syndication - par Nosy - 21/12/2011, 23:40
RE: [script] Eggdrop RSS Syndication - par Nosy - 22/12/2011, 13:29
RE: [script] Eggdrop RSS Syndication - par Nosy - 04/06/2012, 23:27
RE: [script] Eggdrop RSS Syndication - par Nosy - 05/06/2012, 22:27
RE: [script] Eggdrop RSS Syndication - par Nosy - 07/06/2012, 14:21
RE: [script] Eggdrop RSS Syndication - par T3nS - 25/10/2017, 12:01
RE: [script] Eggdrop RSS Syndication - par T3nS - 25/10/2017, 13:02
RE: [script] Eggdrop RSS Syndication - par T3nS - 25/10/2017, 17:18
RE: [script] Eggdrop RSS Syndication - par T3nS - 28/10/2017, 00:23
RE: [script] Eggdrop RSS Syndication - par T3nS - 29/10/2017, 16:19
RE: [script] Eggdrop RSS Syndication - par T3nS - 29/10/2017, 16:56
RE: [script] Eggdrop RSS Syndication - par T3nS - 29/10/2017, 17:11

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)
Tchat 100% gratuit -Discutez en toute liberté