desktopearth on linux script


/ Published in: Perl
Save to your folder(s)

this is a perl scrip that downloads the most recent on demand image and sets the background to it. I know that exec is insecure but I figure it's secure enough inside the box.


Copy this code and paste it in your HTML
  1. #!/usr/bin/perl
  2.  
  3. require LWP::UserAgent;
  4.  
  5. my $ua = LWP::UserAgent->new;
  6. $ua->timeout(10);
  7. $ua->env_proxy;
  8.  
  9. my $response = $ua->get('http://codefromthe70s.org/bin/desktopearthgen.exe?width=1920&height=1200&height=1200&bars=1&center=1&clouds=1&utc='.time);
  10.  
  11.  
  12. open (current,">/home/dcooley/.fluxbox/backgrounds/current.png") || die ("Could not open file\n");
  13.  
  14. if ($response->is_success) {
  15. print current ($response->content);
  16. } else {
  17. die $response->status_line;
  18. }
  19.  
  20.  
  21. close current;
  22.  
  23. exec '/usr/bin/fbsetbg /home/dcooley/.fluxbox/backgrounds/current.png';

URL: codefromthe70s.org

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.