Headline grabber ayuda!
- WBO
- Born


- Registrado: Sep 14, 2003
- Mensajes: 2
- Status: Offline
Han estado tratando de obtener la siguiente secuencia de comandos para volver a trabajar. La función principal es que se agarra a los titulares de Yahoo y los muestra en su sitio.
Cualquier ayuda sería muy apreciada.
WB0
Cualquier ayuda sería muy apreciada.
WB0
Código: [ Select ]
#!/usr/bin/perl
$end = $ENV{'QUERY_STRING'};
use LWP::Simple;
$top = qq~
<head>
<meta http-equiv=Cache-Control content=no-cache>
<meta http-equiv=Pragma content=no-cache>
<META http-equiv=PICS-Label content='(PICS-1.1 "http://www.rsac.org/ratingsv01.html" l gen true comment "RSACi North America Server" on "1999.07.26T09:49-0800" for "http://dailynews.yahoo.com" r (n 0 s 0 v 0 l 0) "http://www.rsac.org/ratingsv01.html" l gen true for "http://rd.yahoo.com" r (n 0 s 0 v 0 l 0) "http://www.rsac.org/ratingsv01.html" l gen true for "http://fullcoverage.yahoo.com" r (n 0 s 0 v 0 l 0) "http://www.rsac.org/ratingsv01.html" l gen true for "http://news.yahoo.com" r (n 0 s 0 v 0 l 0) "http://www.rsac.org/ratingsv01.html" l gen true for "http://vision.yahoo.com" r (n 0 s 0 v 0 l 0) "http://www.rsac.org/ratingsv01.html" l gen true for "http://search.news.yahoo.com" r (n 0 s 0 v 0 l 0))'>
<base href=http://dailynews.yahoo.com/>
<script language=javascript>
var remote = null;
function rs(n,u,w,h){
remote = window.open(u, n, 'width=' + w + ',height=' + h +',resizable=yes,scrollbars=yes');
if (remote != null) {
if (remote.opener == null)
remote.opener = self;
window.name = 'yahooNewsRoot';
remote.location.href = u;
}
}
</script>
</head>
~;
print "Content-type: text/html\n\n";
#Yahoo Top Stories
if ($end eq "top") {
$html = get("http://dailynews.yahoo.com/");
main();
print "$top$html[0]";
}
#Yahoo Business
elsif ($end eq "bus") {
$html = get("http://dailynews.yahoo.com/h/bs/nm/?u");
business_snapshot();
main2();
print "$top$snap";
print "$html[0]";
}
#Yahoo Entertainment News
elsif ($end eq "ent") {
$html = get("http://dailynews.yahoo.com/h/en/nm/?u");
main2();
print "$top$html[0]";
}
#Yahoo Technology News
elsif ($end eq "tec") {
$html = get("http://dailynews.yahoo.com/h/tc/nm/?u");
main2();
print "$top$html[0]";
}
#Yahoo Political News
elsif ($end eq "pol") {
$html = get("http://dailynews.yahoo.com/h/pl/nm/?u");
main2();
print "$top$html[0]";
}
#Yahoo Sports News
elsif ($end eq "spo") {
$html = get("http://dailynews.yahoo.com/h/sp/ap/?u");
main2();
print "$top$html[0]";
}
#Yahoo World News
elsif ($end eq "wor") {
$html = get("http://dailynews.yahoo.com/h/wl/nm/?u");
main2();
print "$top$html[0]";
}
#Yahoo Science News
elsif ($end eq "sci") {
$html = get("http://dailynews.yahoo.com/h/sc/nm/?u");
main2();
print "$top$html[0]";
}
#Yahoo Health News
elsif ($end eq "hea") {
$html = get("http://dailynews.yahoo.com/h/hl/nm/?u");
main2();
print "$top$html[0]";
}
#Yahoo Oddly Enough
elsif ($end eq "odd") {
$html = get("http://dailynews.yahoo.com/h/od/nm/?u");
main2();
print "$top$html[0]";
}
#Yahoo Crime and Trials
elsif ($end eq "cri") {
$html = get("http://dailynews.yahoo.com/h/cr/ct/?u");
main2();
print "$top$html[0]";
}
#Yahoo Lifestyles
elsif ($end eq "lif") {
$html = get("http://dailynews.yahoo.com/h/lf/nm/?u");
main2();
print "$top$html[0]";
}
else {
print "<font color=red><center><b><h2>Please Check Your SSI Path.<h2></b></center></font>";
}
sub main{
@html = split(/<!-- _JC_ MIDDLE COLUMN -->/,$html);
@html = split(/<!-- _JC_ END MIDDLE COLUMN -->/,$html[1]);
$html[0] =~ s/\">/\" target=\_blank\">/ig;
$html[0] =~ s/bgcolor=dcdcdc/bgcolor=$table_bg/ig;
$html[0] =~ s/window\.location\.replace\(window\.location\)\;//ig;
return $html[0]
}
sub business_snapshot{
@html = split(/<!-- _JC_ MARKET SNAPSHOT -->/,$html);
@html = split(/<!-- _JC_ END MARKET SNAPSHOT -->/,$html[2]);
$html[0] =~ s/bgcolor=\"#ccccff\"/bgcolor=$table_bg/ig;
$snap = $html[0];
return $snap
}
sub main2{
@html = split(/<!-- _JC_ STORIES -->/,$html);
@html = split(/<!-- _JC_ END STORIES -->/,$html[1]);
$html[0] =~ s/.html>/.html target=\_blank>/ig;
$html[0] =~ s/<img src=..*>//ig;
return $html[0]
}
$end = $ENV{'QUERY_STRING'};
use LWP::Simple;
$top = qq~
<head>
<meta http-equiv=Cache-Control content=no-cache>
<meta http-equiv=Pragma content=no-cache>
<META http-equiv=PICS-Label content='(PICS-1.1 "http://www.rsac.org/ratingsv01.html" l gen true comment "RSACi North America Server" on "1999.07.26T09:49-0800" for "http://dailynews.yahoo.com" r (n 0 s 0 v 0 l 0) "http://www.rsac.org/ratingsv01.html" l gen true for "http://rd.yahoo.com" r (n 0 s 0 v 0 l 0) "http://www.rsac.org/ratingsv01.html" l gen true for "http://fullcoverage.yahoo.com" r (n 0 s 0 v 0 l 0) "http://www.rsac.org/ratingsv01.html" l gen true for "http://news.yahoo.com" r (n 0 s 0 v 0 l 0) "http://www.rsac.org/ratingsv01.html" l gen true for "http://vision.yahoo.com" r (n 0 s 0 v 0 l 0) "http://www.rsac.org/ratingsv01.html" l gen true for "http://search.news.yahoo.com" r (n 0 s 0 v 0 l 0))'>
<base href=http://dailynews.yahoo.com/>
<script language=javascript>
var remote = null;
function rs(n,u,w,h){
remote = window.open(u, n, 'width=' + w + ',height=' + h +',resizable=yes,scrollbars=yes');
if (remote != null) {
if (remote.opener == null)
remote.opener = self;
window.name = 'yahooNewsRoot';
remote.location.href = u;
}
}
</script>
</head>
~;
print "Content-type: text/html\n\n";
#Yahoo Top Stories
if ($end eq "top") {
$html = get("http://dailynews.yahoo.com/");
main();
print "$top$html[0]";
}
#Yahoo Business
elsif ($end eq "bus") {
$html = get("http://dailynews.yahoo.com/h/bs/nm/?u");
business_snapshot();
main2();
print "$top$snap";
print "$html[0]";
}
#Yahoo Entertainment News
elsif ($end eq "ent") {
$html = get("http://dailynews.yahoo.com/h/en/nm/?u");
main2();
print "$top$html[0]";
}
#Yahoo Technology News
elsif ($end eq "tec") {
$html = get("http://dailynews.yahoo.com/h/tc/nm/?u");
main2();
print "$top$html[0]";
}
#Yahoo Political News
elsif ($end eq "pol") {
$html = get("http://dailynews.yahoo.com/h/pl/nm/?u");
main2();
print "$top$html[0]";
}
#Yahoo Sports News
elsif ($end eq "spo") {
$html = get("http://dailynews.yahoo.com/h/sp/ap/?u");
main2();
print "$top$html[0]";
}
#Yahoo World News
elsif ($end eq "wor") {
$html = get("http://dailynews.yahoo.com/h/wl/nm/?u");
main2();
print "$top$html[0]";
}
#Yahoo Science News
elsif ($end eq "sci") {
$html = get("http://dailynews.yahoo.com/h/sc/nm/?u");
main2();
print "$top$html[0]";
}
#Yahoo Health News
elsif ($end eq "hea") {
$html = get("http://dailynews.yahoo.com/h/hl/nm/?u");
main2();
print "$top$html[0]";
}
#Yahoo Oddly Enough
elsif ($end eq "odd") {
$html = get("http://dailynews.yahoo.com/h/od/nm/?u");
main2();
print "$top$html[0]";
}
#Yahoo Crime and Trials
elsif ($end eq "cri") {
$html = get("http://dailynews.yahoo.com/h/cr/ct/?u");
main2();
print "$top$html[0]";
}
#Yahoo Lifestyles
elsif ($end eq "lif") {
$html = get("http://dailynews.yahoo.com/h/lf/nm/?u");
main2();
print "$top$html[0]";
}
else {
print "<font color=red><center><b><h2>Please Check Your SSI Path.<h2></b></center></font>";
}
sub main{
@html = split(/<!-- _JC_ MIDDLE COLUMN -->/,$html);
@html = split(/<!-- _JC_ END MIDDLE COLUMN -->/,$html[1]);
$html[0] =~ s/\">/\" target=\_blank\">/ig;
$html[0] =~ s/bgcolor=dcdcdc/bgcolor=$table_bg/ig;
$html[0] =~ s/window\.location\.replace\(window\.location\)\;//ig;
return $html[0]
}
sub business_snapshot{
@html = split(/<!-- _JC_ MARKET SNAPSHOT -->/,$html);
@html = split(/<!-- _JC_ END MARKET SNAPSHOT -->/,$html[2]);
$html[0] =~ s/bgcolor=\"#ccccff\"/bgcolor=$table_bg/ig;
$snap = $html[0];
return $snap
}
sub main2{
@html = split(/<!-- _JC_ STORIES -->/,$html);
@html = split(/<!-- _JC_ END STORIES -->/,$html[1]);
$html[0] =~ s/.html>/.html target=\_blank>/ig;
$html[0] =~ s/<img src=..*>//ig;
return $html[0]
}
- #!/usr/bin/perl
- $end = $ENV{'QUERY_STRING'};
- use LWP::Simple;
- $top = qq~
- <head>
- <meta http-equiv=Cache-Control content=no-cache>
- <meta http-equiv=Pragma content=no-cache>
- <META http-equiv=PICS-Label content='(PICS-1.1 "http://www.rsac.org/ratingsv01.html" l gen true comment "RSACi North America Server" on "1999.07.26T09:49-0800" for "http://dailynews.yahoo.com" r (n 0 s 0 v 0 l 0) "http://www.rsac.org/ratingsv01.html" l gen true for "http://rd.yahoo.com" r (n 0 s 0 v 0 l 0) "http://www.rsac.org/ratingsv01.html" l gen true for "http://fullcoverage.yahoo.com" r (n 0 s 0 v 0 l 0) "http://www.rsac.org/ratingsv01.html" l gen true for "http://news.yahoo.com" r (n 0 s 0 v 0 l 0) "http://www.rsac.org/ratingsv01.html" l gen true for "http://vision.yahoo.com" r (n 0 s 0 v 0 l 0) "http://www.rsac.org/ratingsv01.html" l gen true for "http://search.news.yahoo.com" r (n 0 s 0 v 0 l 0))'>
- <base href=http://dailynews.yahoo.com/>
- <script language=javascript>
- var remote = null;
- function rs(n,u,w,h){
- remote = window.open(u, n, 'width=' + w + ',height=' + h +',resizable=yes,scrollbars=yes');
- if (remote != null) {
- if (remote.opener == null)
- remote.opener = self;
- window.name = 'yahooNewsRoot';
- remote.location.href = u;
- }
- }
- </script>
- </head>
- ~;
- print "Content-type: text/html\n\n";
- #Yahoo Top Stories
- if ($end eq "top") {
- $html = get("http://dailynews.yahoo.com/");
- main();
- print "$top$html[0]";
- }
- #Yahoo Business
- elsif ($end eq "bus") {
- $html = get("http://dailynews.yahoo.com/h/bs/nm/?u");
- business_snapshot();
- main2();
- print "$top$snap";
- print "$html[0]";
- }
- #Yahoo Entertainment News
- elsif ($end eq "ent") {
- $html = get("http://dailynews.yahoo.com/h/en/nm/?u");
- main2();
- print "$top$html[0]";
- }
- #Yahoo Technology News
- elsif ($end eq "tec") {
- $html = get("http://dailynews.yahoo.com/h/tc/nm/?u");
- main2();
- print "$top$html[0]";
- }
- #Yahoo Political News
- elsif ($end eq "pol") {
- $html = get("http://dailynews.yahoo.com/h/pl/nm/?u");
- main2();
- print "$top$html[0]";
- }
- #Yahoo Sports News
- elsif ($end eq "spo") {
- $html = get("http://dailynews.yahoo.com/h/sp/ap/?u");
- main2();
- print "$top$html[0]";
- }
- #Yahoo World News
- elsif ($end eq "wor") {
- $html = get("http://dailynews.yahoo.com/h/wl/nm/?u");
- main2();
- print "$top$html[0]";
- }
- #Yahoo Science News
- elsif ($end eq "sci") {
- $html = get("http://dailynews.yahoo.com/h/sc/nm/?u");
- main2();
- print "$top$html[0]";
- }
- #Yahoo Health News
- elsif ($end eq "hea") {
- $html = get("http://dailynews.yahoo.com/h/hl/nm/?u");
- main2();
- print "$top$html[0]";
- }
- #Yahoo Oddly Enough
- elsif ($end eq "odd") {
- $html = get("http://dailynews.yahoo.com/h/od/nm/?u");
- main2();
- print "$top$html[0]";
- }
- #Yahoo Crime and Trials
- elsif ($end eq "cri") {
- $html = get("http://dailynews.yahoo.com/h/cr/ct/?u");
- main2();
- print "$top$html[0]";
- }
- #Yahoo Lifestyles
- elsif ($end eq "lif") {
- $html = get("http://dailynews.yahoo.com/h/lf/nm/?u");
- main2();
- print "$top$html[0]";
- }
- else {
- print "<font color=red><center><b><h2>Please Check Your SSI Path.<h2></b></center></font>";
- }
- sub main{
- @html = split(/<!-- _JC_ MIDDLE COLUMN -->/,$html);
- @html = split(/<!-- _JC_ END MIDDLE COLUMN -->/,$html[1]);
- $html[0] =~ s/\">/\" target=\_blank\">/ig;
- $html[0] =~ s/bgcolor=dcdcdc/bgcolor=$table_bg/ig;
- $html[0] =~ s/window\.location\.replace\(window\.location\)\;//ig;
- return $html[0]
- }
- sub business_snapshot{
- @html = split(/<!-- _JC_ MARKET SNAPSHOT -->/,$html);
- @html = split(/<!-- _JC_ END MARKET SNAPSHOT -->/,$html[2]);
- $html[0] =~ s/bgcolor=\"#ccccff\"/bgcolor=$table_bg/ig;
- $snap = $html[0];
- return $snap
- }
- sub main2{
- @html = split(/<!-- _JC_ STORIES -->/,$html);
- @html = split(/<!-- _JC_ END STORIES -->/,$html[1]);
- $html[0] =~ s/.html>/.html target=\_blank>/ig;
- $html[0] =~ s/<img src=..*>//ig;
- return $html[0]
- }
- Anonymous
- Bot


- Registrado: 25 Feb 2008
- Mensajes: ?
- Loc: Ozzuland
- Status: Online
Septiembre 14th, 2003, 8:06 am
- b_heyer
- Web Master


- Registrado: Jun 15, 2003
- Mensajes: 4583
- Loc: Maryland
- Status: Offline
- WBO
- Born


- Registrado: Sep 14, 2003
- Mensajes: 2
- Status: Offline
- Bigwebmaster
- Site Admin


- Registrado: Dic 20, 2002
- Mensajes: 8926
- Loc: Seattle, WA & Phoenix, AZ
- Status: Offline
Apuesto a que la razón no funciona es porque ya no su dailynews.yahoo.com, que URL redirecciona a algo como esto ahora:
http://story.news.yahoo.com/news?tmpl=index&cid=579
por lo que creo que necesita para ajustar la URL que va a lo que no es reorientar, y que podría resolver su problema. Si esto no funciona entonces el formato de las páginas podría haber cambiado lo suficiente en que su script no sabe cómo analizar la página más, es decir, gran parte de su script podría tener que ser reescrito. Su escritura no es tan grande aunque, por lo que si sé PERL no debería ser demasiado difícil. Si no sabe PERL recomiendo a encontrar el lugar que recibió el guión y ver si tienen una actualización.
http://story.news.yahoo.com/news?tmpl=index&cid=579
por lo que creo que necesita para ajustar la URL que va a lo que no es reorientar, y que podría resolver su problema. Si esto no funciona entonces el formato de las páginas podría haber cambiado lo suficiente en que su script no sabe cómo analizar la página más, es decir, gran parte de su script podría tener que ser reescrito. Su escritura no es tan grande aunque, por lo que si sé PERL no debería ser demasiado difícil. Si no sabe PERL recomiendo a encontrar el lugar que recibió el guión y ver si tienen una actualización.
Ozzu Hosting - Want your website on a fast server like Ozzu?
Página 1 de 1
Para responder a este tema que necesita para ingresar o registrarse. Es gratis.
Publicar Información
- Total de mensajes en este tema: 4 mensajes
- Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 122 invitados
- No puede abrir nuevos temas en este Foro
- No puede responder a temas en este Foro
- No puede editar sus mensajes en este Foro
- No puede borrar sus mensajes en este Foro
- No puede enviar adjuntos en este Foro
