View previous topic :: View next topic |
Author |
Message |
bld l33t
Joined: 26 Mar 2003 Posts: 759 Location: Outter Space
|
Posted: Mon Sep 22, 2003 11:57 pm Post subject: GWN |
|
|
ce una versione di GWN in italiano?
posso riceverla via email .. tipo mailing list ?
grazie _________________ A happy GNU/Linux user!! |
|
Back to top |
|
|
fedeliallalinea Administrator
Joined: 08 Mar 2003 Posts: 31461 Location: here
|
Posted: Tue Sep 23, 2003 6:09 am Post subject: Re: GWN |
|
|
bld wrote: | ce una versione di GWN in italiano? |
Si eccola.
bld wrote: | posso riceverla via email .. tipo mailing list ?
grazie |
Non penso _________________ Questions are guaranteed in life; Answers aren't. |
|
Back to top |
|
|
cerri Bodhisattva
Joined: 05 Mar 2003 Posts: 2957 Location: # init S
|
Posted: Tue Sep 23, 2003 6:39 am Post subject: |
|
|
In inglese si. _________________ Enjoy your freedom.
Sex is like hacking. You get in, you get out, and you hope you didnt leave something behind that can be traced back to you.
<----------------------->
Andrea Cerrito |
|
Back to top |
|
|
shev Bodhisattva
Joined: 03 Feb 2003 Posts: 4084 Location: Italy
|
Posted: Tue Sep 23, 2003 2:11 pm Post subject: Re: GWN |
|
|
bld wrote: | ce una versione di GWN in italiano?
posso riceverla via email .. tipo mailing list ?
grazie |
Se vuoi ti mando io il link alla versione italiana ogni lunedì _________________ Se per vivere ti dicono "siediti e stai zitto" tu alzati e muori combattendo |
|
Back to top |
|
|
fedeliallalinea Administrator
Joined: 08 Mar 2003 Posts: 31461 Location: here
|
Posted: Tue Sep 23, 2003 3:27 pm Post subject: Re: GWN |
|
|
Shev wrote: | Se vuoi ti mando io il link alla versione italiana ogni lunedì |
Se bld non accetta io mi metto in coda (non del lupo). _________________ Questions are guaranteed in life; Answers aren't. |
|
Back to top |
|
|
paolo l33t
Joined: 23 Jul 2002 Posts: 768 Location: SBT (AP)
|
Posted: Tue Sep 23, 2003 9:08 pm Post subject: Re: GWN |
|
|
Shev wrote: | bld wrote: | ce una versione di GWN in italiano?
posso riceverla via email .. tipo mailing list ?
grazie |
Se vuoi ti mando io il link alla versione italiana ogni lunedì |
Code: |
L OO L
L O O L
LLL OO LLL |
_________________ Nihil sine magno labore |
|
Back to top |
|
|
Ginko Guru
Joined: 01 May 2002 Posts: 371 Location: nearby my linux laptop
|
Posted: Wed Sep 24, 2003 10:06 am Post subject: Re: GWN |
|
|
bld wrote: | posso riceverla via email
grazie |
Si con questo script
Code: |
#!/usr/bin/perl -w
#
######################################################################
#
# __
# ____ ___ __/ /_____ ____ __ ______
# / __ `/ / / / __/ __ \/ __ `/ | /| / / __ \
# / /_/ / /_/ / /_/ /_/ / /_/ /| |/ |/ / / / /
# \__,_/\__,_/\__/\____/\__, / |__/|__/_/ /_/
# /____/
#
# Created on: Wed Sep 24 09:14:22 2003
# Author: Gianluca rotoni, Software Engineer
#
# Copyright (C) 2003 Gianluca Rotoni <gianluca@rotoni.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
######################################################################
#
# A script to automatically send the Gentoo Weekly Newsletter via Mail
use strict;
use LWP::Simple;
use MIME::Lite;
package main;
# Configuration Parameters
#
# Define the desired language
#
# Valid languages are :
#
# be (Dutch)
# en (English)
# de (German)
# fr (French)
# ja (Japanese)
# it (Italian)
# pl (Polish)
# br (Portuguese Brazil)
# pt (Portuguese Portugal)
# ru (Russian)
# es (Spanish)
# tr (Turkish)
#
my $language = "it";
#
# Mail configuration
#
my $gwn_recipient = "you\@your.domain";
my $gwn_sender = "anyone\@any.domain";
#
# Get todays date, if it's not Monday get latest Monday's date
#
my $time = time();
my $monday = 1;
my $wday = (localtime)[6];
if ($wday != $monday) {
for ($time=time(); (localtime($time))[6] != $monday; $time -= 86400) {}
} else {
$time = time();
}
#
# Format last Monday's date as YYYYMMDD
#
my ($year,$month,$day) = (localtime($time))[5,4,3];
my $datum = sprintf("%d%02d%02d", $year + 1900, $month+1, $day);
#
# Calculate last Monday's GWN url
#
my $gwn_url = "http://www.gentoo.org/news/$language/gwn/$datum-newsletter.xml";
#
# Get the GWN via Web
#
my $gwn_content = get($gwn_url);
die "Couldn't get the GWN for date $datum language $language!"
unless defined $gwn_content;
#
# Construct a MIME type text/html and
# send it via Email to the specified address
#
my $gwn_msg = MIME::Lite->new(
To => $gwn_recipient,
From => $gwn_sender,
Subject => "Gentoo Weekly Newsletter ($datum,$language)",
Type => 'text/html',
Data => $gwn_content,
);
$gwn_msg->send;
exit 0;
1;
|
Ti servono LWP::Simple e MIME::Lite.
Puoi eseguire lo script in qualsiasi momento, lui si calcola la data dell'ultimo lunedi' e ti manda la GWN nella lingua desiderata via Email.
Saluti
--Gianluca |
|
Back to top |
|
|
bld l33t
Joined: 26 Mar 2003 Posts: 759 Location: Outter Space
|
Posted: Wed Sep 24, 2003 10:42 am Post subject: bella |
|
|
Grazie gianluca
se avesse anche ssl+pgp support sarebbe il max
e poi cosa metto su "my_gwn@sender"
magar hmm... i shev@chi-sa-dove.chi-sa-cosa _________________ A happy GNU/Linux user!! |
|
Back to top |
|
|
codadilupo Advocate
Joined: 05 Aug 2003 Posts: 3135
|
Posted: Wed Sep 24, 2003 11:21 am Post subject: Re: GWN |
|
|
Ginko wrote: | bld wrote: | posso riceverla via email
grazie |
Si con questo script
|
Ginko, il geco che geekka
(shev é un esteta della parola, io sono un'estetista dei giochi delle medesime )
Coda |
|
Back to top |
|
|
Ginko Guru
Joined: 01 May 2002 Posts: 371 Location: nearby my linux laptop
|
Posted: Wed Sep 24, 2003 11:58 am Post subject: Re: bella |
|
|
bld wrote: | Grazie gianluca |
Figurati
bld wrote: | se avesse anche ssl+pgp support sarebbe il max |
Perche' ssl? La GWN s' disponibile plain text.
La signature GPG si puo' fare usando Crypt::GPG, ma ne vale veramente la pena?
bld wrote: | e poi cosa metto su "my_gwn@sender"
magar hmm... i shev@chi-sa-dove.chi-sa-cosa |
Perche' no? In pratica puoi pure mettere :
Daniel.Robbins\@gentoo.org
--Gianluca |
|
Back to top |
|
|
bld l33t
Joined: 26 Mar 2003 Posts: 759 Location: Outter Space
|
Posted: Wed Sep 24, 2003 12:36 pm Post subject: porca !@#$@! |
|
|
Dai un occhiata tu, non so cosa fare per Simple.pm
--------------------------
bld@oxygen bin $ chmod +x gwn
bld@oxygen bin $ ls
gwn
bld@oxygen bin $ ./gwn
Can't locate LWP/Simple.pm in @INC (@INC contains: /etc/perl /usr/lib/perl5/site_perl/5.8.0/i686-linux /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i686-linux /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i686-linux /usr/lib/perl5/5.8.0 /usr/local/lib/site_perl .) at ./gwn line 37.
BEGIN failed--compilation aborted at ./gwn line 37.
--------------------------
boh.. _________________ A happy GNU/Linux user!! |
|
Back to top |
|
|
Ginko Guru
Joined: 01 May 2002 Posts: 371 Location: nearby my linux laptop
|
Posted: Wed Sep 24, 2003 12:56 pm Post subject: Re: porca !@#$@! |
|
|
bld wrote: | Dai un occhiata tu, non so cosa fare per Simple.pm |
Fai cosi :
Code: | emerge dev-perl/libwww-perl
|
e se non hai MIME::Lite, fai pure cosi' :
Code: | emerge dev-perl/MIME-Lite
|
--Gianluca |
|
Back to top |
|
|
shev Bodhisattva
Joined: 03 Feb 2003 Posts: 4084 Location: Italy
|
Posted: Wed Sep 24, 2003 6:52 pm Post subject: Re: GWN |
|
|
Ginko wrote: | bld wrote: | posso riceverla via email
grazie |
Si con questo script
|
Granderrimo!
Appena posso lo provo, come sempre la comunità gentoo mostra il suo splendore
codadilupo wrote: |
(shev é un esteta della parola, io sono un'estetista dei giochi delle medesime ) |
Sono un "narcisista della parola" fondamentalmente, ma anche questa tua definizione potrebbe calzare... aggiudicata _________________ Se per vivere ti dicono "siediti e stai zitto" tu alzati e muori combattendo |
|
Back to top |
|
|
codadilupo Advocate
Joined: 05 Aug 2003 Posts: 3135
|
Posted: Wed Sep 24, 2003 9:11 pm Post subject: Re: GWN |
|
|
Shev wrote: | codadilupo wrote: | (shev é un esteta della parola, io sono un'estetista dei giochi delle medesime ) | Sono un "narcisista della parola" fondamentalmente, ma anche questa tua definizione potrebbe calzare... aggiudicata |
questo vuol dire che mi *perdoni* ?
Dai, giurin giuretta non lo faccio piu'. (anche se resto del parere.... )
Coda |
|
Back to top |
|
|
shev Bodhisattva
Joined: 03 Feb 2003 Posts: 4084 Location: Italy
|
Posted: Thu Sep 25, 2003 4:31 pm Post subject: Re: GWN |
|
|
codadilupo wrote: |
questo vuol dire che mi *perdoni* ? |
Assolutamente no, non esiste perdono per ciò che hai detto
Quote: | (anche se resto del parere.... )
|
Vieni a Venezia che ne parliamo, vedrai che ti convinco (con le buone o con le cattive...)
Scherzi a parte, mi raccomando venite a Venezia! _________________ Se per vivere ti dicono "siediti e stai zitto" tu alzati e muori combattendo |
|
Back to top |
|
|
bld l33t
Joined: 26 Mar 2003 Posts: 759 Location: Outter Space
|
Posted: Thu Sep 25, 2003 11:36 pm Post subject: ancora :(( |
|
|
Scusa la mia insistenza ma siccome mi piace come cosa
insisto un po piu.. per me ancora non va
per voi altri va questo script?
----------------------
[bld[@]oxygen:~/bin]> ./gwn
sendmail: fatal: gethostbyname: No such file or directory
-------------------------
forse ho fatto qualche errorino nella configurazione? _________________ A happy GNU/Linux user!! |
|
Back to top |
|
|
bld l33t
Joined: 26 Mar 2003 Posts: 759 Location: Outter Space
|
Posted: Fri Sep 26, 2003 12:00 am Post subject: bld |
|
|
hehe ok fatto!
L'errore era sulla configurazione di postfix
Non l'avevo configurato perche installato
recentemente!
Sto aspettando con anzia la mail!!!!!!
ancora non e' arrivatta! _________________ A happy GNU/Linux user!! |
|
Back to top |
|
|
teknux Guru
Joined: 19 Feb 2003 Posts: 517 Location: Rome, IT
|
Posted: Mon Oct 20, 2003 3:44 pm Post subject: |
|
|
ripesco al volo sto post. non avendo molto da fare e volendo giocherellare un po' con python per imparare il linguaggio, ho provato a scrivere una versione in python del codice di Ginko. In questo modo si può evitare di emergere alcuni moduli perl solo per questo.
L'ho provato ed al momento non mi da errori (almeno il parser), ma non essendo ancora uscita la nuova GWN (ed essendo oggi lunedì) lo script fallisce miseramente. il modo di operare è pressochè identico (anche perchè altrimenti non avrei avuto idea di come fare ), tranne per il fatto che usa la libreria standard di Python.
spero possa tornarvi utile. ogni commento/insulto/correzione è ovviamente ben accetto. può darsi che migliorerò la gestione degli errori e di alcune eccezioni, chissà
ad ogni modo eccovi il codice:
Code: |
#!/usr/bin/python2.2
#
# very simple python-port of Gianluca Rotoni's "AUTOGWN" (I kept some #comments)
# it can be useful (maybe). made for fun and didactical purposes
# made by teknux <teknux@yahoo.it>
#
# thanks to Gianluca Rotoni (without his Perl code I wasn't able to #write my Python version :P)
# and all the GECHI users :-)
import sys as sys
from time import *
import httplib
import smtplib
from email.MIMEText import MIMEText
# User configuration
language = "it"
gwn_recipe = "user\@domain.tld"
gwn_sender = "you\@yourdomain.tld"
smtp_host = "localhost"
smtp_port = 25
# Get todays date, if it's not Monday get latest Monday's date
today = gmtime(int(time()))
if today != 0:
gettime = gmtime(int(time()))
while gettime [6] != 0:
gettime = gmtime(int(time()) - 86400)
else:
gettime = today
# Format last Monday's date as YYYYMMDD
datum = strftime("%Y%m%d", gettime)
# Try to get last Monday GWN
gwn_host = "www.gentoo.org"
gwn_path = "/news/"+language+"/gwn/"+datum+"-newsletter.xml"
conn = httplib.HTTPConnection(gwn_host)
conn.request("GET", gwn_path)
resp = conn.getresponse()
if (resp.status != "200") and (resp.reason != "OK"):
print "ERROR: couldn't get the GWN for: "+datum+"""
in language: """+language+"... exiting!"
sys.exit(-1)
print "OK: "+ gwn_host + gwn_path +"FOUND!"
print "Retriving GWN for: "+datum+" in language: "+language+"..."
data = resp.read()
conn.close()
# send it via Email to the specified address
print "Sending last GWN to "+gwn_recipe+" from"+gwn_sender+"..."
msg = MIMEText(data)
msg['Subject'] = "Gentoo Weekly Newsletter ("+datum+"-"+language+")"
msg['From'] = gwn_sender
msg['To'] = gwn_recipe
mail = smtplib.SMTP(smtp_host, smtp_port)
mail.connect()
mail.sendmail(gwn_sender, gwn_recipe, msg.as_string())
mail.close()
sys.exit(0)
|
buon divertimento!
saluti,
tek
EDIT: corrette alcune virgole per andare a capo, altriementi avreste ricevuto errori (credo)
EDIT2: come non detto. ora dovrebbe andare. copiate e incollate, se non funzia lo metto sul mio hosting e lo scaricate da lì, o lo mando in mail a chi me lo chiede
Last edited by teknux on Mon Oct 20, 2003 3:58 pm; edited 1 time in total |
|
Back to top |
|
|
shev Bodhisattva
Joined: 03 Feb 2003 Posts: 4084 Location: Italy
|
Posted: Mon Oct 20, 2003 3:53 pm Post subject: |
|
|
teknux wrote: | ripesco al volo sto post. non avendo molto da fare e volendo giocherellare un po' con python per imparare il linguaggio, ho provato a scrivere una versione in python del codice di Ginko. |
Grande, così anche i sostenitori di python hanno la loro versione
/me che ha da sempre un debole per python _________________ Se per vivere ti dicono "siediti e stai zitto" tu alzati e muori combattendo |
|
Back to top |
|
|
teknux Guru
Joined: 19 Feb 2003 Posts: 517 Location: Rome, IT
|
Posted: Mon Oct 20, 2003 4:04 pm Post subject: |
|
|
Shev wrote: |
Grande, così anche i sostenitori di python hanno la loro versione
/me che ha da sempre un debole per python |
infatti hai centrato entrambe le mie motivazioni :
1) avere una versione in python (anche perchè la storia di emergere moduli perl per usare un solo porgramma non mi andava a genio) di un programma utilissimo;
2) anche io ho sempre avuto qualche attenzione per python, sebbene non mi piaccia molto la programmazione a oggetti. ma python è bello perchè anche uno che non lo conosce quasi per niente (come me) riesce a tirare fuori qualcosa di decente. per scrivere sto programmino ho preso il "modules reference" e mi sono messo a cercare le funzioni che mi sarebbero potute servire. è ovvio che senza il codice in perl di ginko potevo anche sognarmelo di scrivere la stessa cosa in meno di un'oretta
saluti,
tek |
|
Back to top |
|
|
teknux Guru
Joined: 19 Feb 2003 Posts: 517 Location: Rome, IT
|
Posted: Mon Oct 20, 2003 6:56 pm Post subject: |
|
|
a proposito...
non soddisfatto dal fatto che se non trova l'ultima gwn lo script (o programma? fate voi) fallisce con un errore, ho cominciato a lavorarci un po' sopra affinchè scarichi l'ultima disponibile. So che al limite potrebbe essere una cosa poco carina ma è solo una prova
fatto sta che mentre smadonnavo sul modificare la data e tornare a una settimana prima (ho creato una funzione apposita, ma non capisco perchè lascia invariata la data... vedrò), ho *scoperto* che è possibile raggiungere la GWN italiana in 2 diversi modi:
1) http://www.gentoo.org/news/it/gwn/20031013-newsletter.xml (almeno è l'ultima)
2) http://www.gentoo.org/news/it/gwn/current.xml
quindi potrebbe essere carino che punti direttamente alla current. anche se di fatto si potrebbe ricevere la stessa GWN per più di una volta...
il fatto invece di andare una settimana indietro, ammesso che prima o poi ci riesca, mi sta solleticando l'idea per aggiungere altre funzioni, tipo aggiungere un'opzione che scarichi TUTTE le GWN (sai com'è per i nuovi utenti che si vogliono leggere anche quelle passate... )
se mi date qualche idea a riguardo ne sarei felice
saluti,
tek (che tempo un altro po' di smadonni e comincia davvero a strisciare a terra come... un pitone ) |
|
Back to top |
|
|
teknux Guru
Joined: 19 Feb 2003 Posts: 517 Location: Rome, IT
|
Posted: Tue Oct 21, 2003 8:30 am Post subject: |
|
|
EDIT: per non occupare spazio, ho cancellato il messaggio precedente e ripost qui la versione FUNZIONANTE del mio GWNshooter. Ora riconosce l'encoding in html ed è perfettamente leggibile (almeno da sylpheed...). fatemi sapere cosa ne pensate
PS: le stringhe che vanno a capo vanno messe su una sola linea. metterò una versione del file su
http://unixware.sf.net/gwnshooter.py
Code: |
#!/usr/bin/python2.2
#
# GWNshooter v 0.3
#
# Author: teknux <teknux@yahoo.it>
#
# very simple python-port of Gianluca Rotoni's "AUTOGWN" (I kept some comments)
# it can be useful (maybe). made for fun and didactical purposes
#
# thanks to Gianluca Rotoni (without his Perl code I wasn't able to write my Python version :P)
# and all the GECHI users :-)
import sys as sys
from time import *
import httplib
import smtplib
from email.MIMEText import MIMEText
from email import Encoders
# User configuration
language = "it"
gwn_recipe = "recipe@domain.tld"
gwn_sender = "sender@domain.tld"
smtp_host = '10.0.1.1'
# Get todays date, if it's not Monday get latest Monday's date
today = gmtime(int(time()))
if today != 0:
gettime = gmtime(int(time()))
while gettime [6] != 0:
gettime = gmtime(int(time()) - 86400)
else:
gettime = today
# Format last Monday's date as YYYYMMDD
datum = strftime("%Y%m%d", gettime)
# Try to get last Monday GWN (if today is Monday and there isn't a GWN, it fails...)
gwn_host = "www.gentoo.org"
gwn_path = "/news/"+language+"/gwn/"+datum+"-newsletter.xml"
conn = httplib.HTTPConnection(gwn_host)
conn.request("GET", gwn_path)
resp = conn.getresponse()
if (resp.status != "200") and (resp.reason != "OK"):
print "ERROR: couldn't get the GWN for: "+datum+" in language: "+language+"... exiting!"
sys.exit(-1)
print "OK: "+ gwn_host + gwn_path +" FOUND!"
print "Retriving GWN for: "+datum+" in language: "+language+"..."
data = resp.read()
conn.close()
# send it via Email to the specified address
print "Sending last GWN to "+gwn_recipe+" from "+gwn_sender+"..."
msg = MIMEText(data, _subtype='html')
msg['Subject'] = "Gentoo Weekly Newsletter ("+datum+"-"+language+")"
msg['From'] = gwn_sender
msg['To'] = gwn_recipe
Encoders.encode_base64(msg)
mail = smtplib.SMTP(smtp_host)
mail.sendmail(gwn_sender, gwn_recipe, msg.as_string())
mail.quit()
sys.exit(0)
|
saluti,
tek |
|
Back to top |
|
|
bld l33t
Joined: 26 Mar 2003 Posts: 759 Location: Outter Space
|
Posted: Fri Nov 07, 2003 3:14 pm Post subject: rehi |
|
|
Tek, ho apena scaricato il programmino in py, perche anche a me
piace moltissimo python!!
Sto imparando ora poco a poco a programmare ho scelto python come
inizio e devo dire che sono soddisfatto!!!
Ma vorrei poter mettere il programma su su crontab, potresti fare vedere come posso
settare vcron? Intendo lo syntax perche io ci ho provato senza successo
Posso cambiare anche cron se me lo sai dare un altro *cron syntax.
Credo che e' una cosa utile per tutti i newbes come me, dovresti mettere le istruzioni per il cron sui comments, oppure far un bash script che fa tutto da solo se eseguito come root(?) [ per quelli che sono molto molto "lazy" ]
Grazie _________________ A happy GNU/Linux user!! |
|
Back to top |
|
|
teknux Guru
Joined: 19 Feb 2003 Posts: 517 Location: Rome, IT
|
Posted: Fri Nov 07, 2003 5:02 pm Post subject: |
|
|
beh innazni tuttto mi fa piacere che ti è utile (almeno a qualcuno....
seconda cosa, puoi scaricare la versione un po' + nuova da gentoo.it o gentoo-italia.it visto che non mi sono degnato di aggiornarla qui sul post
seconda cosa, io non ho mai avuto necessità di usare cron perchè generalmente le cosine me le faccio a mano (e non sono neanche troppe).
non prendermi per scortese, ma ti rimando agli howto in rete, visto che so come funziona ma non mi ci sono mai degnato di approfondire (per ora). sai com'è uno studia quello che deve sapere in base alle proprie esigenze. per ora i demoni cron non mi occorrono...
saluti,
tek |
|
Back to top |
|
|
bubble27 Guru
Joined: 07 Aug 2003 Posts: 365 Location: Campobasso
|
Posted: Mon Nov 10, 2003 7:14 pm Post subject: |
|
|
Mhhh scusate vorrei anche io la GWN come mail... ma con lo scriptino fatto in python (da quel che ho capito) che c'è su gentoo.it, non sono riuscito........ adesso sto provando con l'laltro che ho trovato su questo post ...... xò se qualcuno mi spiegasse un pò in dettaglio come funziona e cosa bisogna editare nel file ma soprattutto di quali programmi si ha bisogno, be aiuterebbe un Gechi ..... tnx
ciao Gentooaglia |
|
Back to top |
|
|
|