A simple pastebin you can run on any server with Apache and PHP.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. $base_url = "https://your.web.site/textfiles/";
  3. if (isset($_GET['f'])) {
  4. render_file();
  5. } else if ( isset($_POST['f'])
  6. && isset($_POST['p'])
  7. && $_POST['p'] == 'YOUR_API_KEY_GOES_HERE') {
  8. new_file();
  9. } else {
  10. header ('Content-type: text/plain; charset=utf-8');
  11. http_response_code(404);
  12. die("NO FILE FOR YOU!! COME BACK, ONE YEAR!");
  13. }
  14. ## Functions
  15. function render_file() {
  16. if ($_GET['m'] == 'raw') {
  17. header ('Content-type: text/plain; charset=utf-8');
  18. echo file_get_contents($_GET['f']);
  19. die;
  20. } else {
  21. header ('Content-type: text/html; charset=utf-8');
  22. include_once(__DIR__ . "/textfiles.html");
  23. die;
  24. }
  25. }
  26. function new_file() {
  27. `export LANG="en_US.UTF-8"`;
  28. $tmp_file_path = trim(`mktemp -q ./XXXXXXXX`);
  29. $tmp_file_name = `basename {$tmp_file_path}`;
  30. `rm {$tmp_file_path}`;
  31. file_put_contents("{$tmp_file_path}.txt", $_POST['f']);
  32. global $base_url;
  33. echo $base_url . $tmp_file_name;
  34. }
  35. ?>