You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.8 KiB

  1. "use strict";
  2. const React = require("react");
  3. const url = require("url");
  4. function NoticeBox({ children, siteName }) {
  5. return (
  6. <div style={{backgroundColor: "#3C0000", color: "white", padding: "4px", margin: "4px"}}>
  7. <strong>This is a mobile proxy.</strong> It is intended to visit {siteName} on devices that would otherwise not correctly display the site. {children}
  8. </div>
  9. );
  10. }
  11. module.exports = {
  12. port: 3000,
  13. hosts: {
  14. "awesomedude.cryto.net": {
  15. prefix: () => (
  16. <NoticeBox siteName="AwesomeDude" />
  17. ),
  18. filters: [{
  19. matchPath: "/",
  20. mapUrl: "http://www.awesomedude.com/",
  21. mapContent: ($) => $("#container").html()
  22. }, {
  23. mapUrl: ({path}) => url.resolve("http://www.awesomedude.com/", path),
  24. mapContent: ($) => $("body").html()
  25. }]
  26. },
  27. "castleroland.cryto.net": {
  28. prefix: () => (
  29. <NoticeBox siteName="CastleRoland.net">
  30. Please direct all your feedback to <a style={{ color: "white" }} href="http://www.castleroland.net/">CastleRoland.net</a> directly!
  31. </NoticeBox>
  32. ),
  33. filters: [{
  34. matchPath: "/",
  35. mapUrl: "https://castleroland.net/stories-categories/",
  36. mapContent: ($) => $("section.home_about").html()
  37. }, {
  38. mapUrl: ({path}) => url.resolve("https://www.castleroland.net/", path),
  39. mapContent: ($) => $("section.home_about").html()
  40. }]
  41. },
  42. "iomfats.cryto.net": {
  43. prefix: () => (
  44. <NoticeBox siteName="the IOMfAtS Story Shelf">
  45. Please direct all your feedback to the <a style={{ color: "white" }} href="http://iomfats.org/aboutme/">friendly guy over at IOMfAtS</a>!
  46. </NoticeBox>
  47. ),
  48. filters: [{
  49. matchPath: "/",
  50. mapUrl: "http://iomfats.org/storyshelf/",
  51. mapContent: ($) => $("div#homelinks").html()
  52. }, {
  53. mapUrl: ({path}) => url.resolve("http://iomfats.org/", path),
  54. mapContent: ($) => $("div#content").html()
  55. }]
  56. }
  57. }
  58. };