Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Master Coder mlseim's Avatar
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,371
    Thanks
    8
    Thanked 1,075 Times in 1,066 Posts

    Fun with Printable-Puzzles (Revisited)

    I like to print out the latest crossword puzzle of the day from www.printable-puzzles.com

    So, to make it quick, I made a PHP script to directly access the PDF file without going through all of their screens. This makes it really easy to print out the puzzle each morning with the execution of one script.

    I had posted this a year or so ago and since then, they recently did a new layout on their web page. That messed-up my HTML parsing. So below is the new PHP script to once again access today's puzzle.

    Enjoy ...

    PHP Code:
    <?php  
    // Printable Crossword Puzzles -  
     
    $the_url "http://www.printable-puzzles.com/printable-crossword-puzzles.php";

    $curl curl_init(); 
    curl_setopt($curlCURLOPT_URL,"$the_url");
    curl_setopt($curlCURLOPT_HEADER0); 
    curl_setopt($curlCURLOPT_RETURNTRANSFER1); 
    curl_setopt($curlCURLOPT_CONNECTTIMEOUT0); 

    $data curl_exec($curl);
    curl_close($curl); 

    // GRAB THE NEWEST CROSSWORD PUZZLE
    $cross_pos strpos($data"Crossword  Puzzle  #"); // they put two spaces in between
    $cross_code substr($data$cross_pos+206); 
    $cross_url="http://www.printable-puzzles.com/dl.php?".$cross_code.".pdf";

    header("location: $cross_url");

    ?>


    .

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,978
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    :O
    Wrong forum
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •