Solved

Will LWP retrieve graphics?

Posted on 2000-04-16
4
169 Views
Last Modified: 2010-03-05
I have a script to retrieve text from a web page. Can I get graphics also?

Thanks!!

Betsy
0
Comment
Question by:garfld
  • 2
  • 2
4 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 50 total points
ID: 2721452
use LWP::Simple;
print status_message(getstore('http://www.experts-exchange.com/images/eelogoleft.gif','eelogoleft.gif'));
0
 
LVL 2

Author Comment

by:garfld
ID: 2721548
Sorry, i wasn't able to generalize from your answer. I'll increase points to 100. Here are my scripts, which gets data from the top story on CNN. First a quick html form script, then the perl:

<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Quotes</title>
</head>
<body background=bkgrnd_tile.gif bgcolor=white leftmargin="50" topmargin="50" marginwidth="50" marginheight="50">
<p>
<div align="center"><h1>get gif!</h1></div>
<div align="center">
<form method="POST" action="http://localhost/cgi-bin/getgif.pl">
<input type="submit" value="  get gif  ">
</form>
</div>
</body>
</html>


use LWP::Simple;
use Text::Wrap;

#print status_message(getstory('http://www.experts-exchange.com/images/eelogoleft.gif','eelogoleft.gif'));

#$news = get ('http://www.cnn.com', 'http://www.cnn.com/2000/US/04/16/dc.protests.02/top.police.force.ap.jpg');

$news = get ("http://www.cnn.com");
$news =~ s/^.*<H3><A href=//s ;  
$news =~ s/FULL STORY.*$//s;
$news =~ s/<[^>]+>//g;
$news =~ s/^.*>//s;

print wrap('', '', $news );


Thanks!!
0
 
LVL 84

Expert Comment

by:ozo
ID: 2722178
If that's supposed to be a CGI program, you probably want to print CGI headers.
0
 
LVL 2

Author Comment

by:garfld
ID: 2723986
Here's the points, Ozo. I found the gif on my directory while I was looking for something else. So I "got" the gif but I didn't see it on a web page.

I'll give you 100 points for fixing my script, the one shown above, so that the web page comes back with text and graphics.

I tried adding a cgi object but must not have done it right.

Thanks!!

Betsy
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now