Mattie432 / YouTweak

Add enhanced functionality to youtube in the form of a multitude of tweaks.
https://chrome.google.com/webstore/detail/youtweak-for-youtube-remo/cfgpigllcihcpkbokdnmpkjobnebflgh
MIT License
26 stars 9 forks source link

Use JSON instead of XML for messages input #51

Open OiYouYeahYou opened 7 years ago

OiYouYeahYou commented 7 years ago

I would suggest that you change your Messages location into JSON. Reducing code liability into JSON.parse( xhrContent ) Making long term maintenance much better.

It would look like this

[
    { "show" : "true" },
    {
        "num" : 15,
        "date" : "2015/04/11",
        "text" : "YouTube is having some issues removing videos at the moment. Clicking remove *will* clear the video, however it may take some time to register and subsequently may show for a while after the page is refreshed. If you refresh the page a few times then YouTube should catch up and eventually not show the video.",
        "ttl" : 7
    }
]

Instead of this

<?xml version="1.0" encoding="utf-8"?>
<messages>
    <show>true</show>
    <message>
        <num>15</num>
        <date>11th Apr 2015</date>
        <text>YouTube is having some issues removing videos at the moment. Clicking remove *will* clear the video, however it may take some time to register and subsequently may show for a while after the page is refreshed. If you refresh the page a few times then YouTube should catch up and eventually not show the video.</text>
        <!-- Time to live of the message in days -->
        <ttl>7</ttl>
    </message>
</messages>