?
Solved

Will LWP retrieve graphics?

Posted on 2000-04-16
4
Medium Priority
?
176 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 150 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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…
Six Sigma Control Plans
Suggested Courses

770 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