Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <meta charset="utf-8">
- <html>
- <head>
- <title>Shared Links</title>
- </head>
- <body>
- <table>
- <thead>
- <?php
- $req = curl_init();
- curl_setopt($req, CURLOPT_URL, "http://hasan.d8u.us/links.py.cgi?format=csv");
- curl_setopt($req, CURLOPT_RETURNTRANSFER, true);
- $to_parse = curl_exec($req);
- $parsed_lines = str_getcsv($to_parse, "\n");
- $header = str_getcsv($parsed_lines[0], ",");
- echo "<tr><th>".$header[0]."</th><th>".$header[1]."</th><th>".$header[2]."</th></tr>";
- ?>
- </thead><tbody>
- <?php
- for ($i = count($parsed_lines)-1;$i != 0; $i--) {
- $row = str_getcsv($parsed_lines[$i]);
- $time_ = new DateTime();
- $time_ -> setTimestamp($row[2]);
- $time = $time_->format('Y-m-d\TH:i:s');
- $link = "<a href=\"".$row[1]."\">"."Go to link"."</a>";
- print("<tr><td>$row[0]</td><td>$link</td><td>$time</td></tr>");
- }
- ?>
- </tbody>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement