Posts

Showing posts with the label JSON

2023-12-20: JSON Schemas Help You Write Better JSON

Image
JSON schemas are a powerful tool for validating the structure and data types of JSON documents. They can help you ensure that your JSON data conforms to a specific format, avoid errors, and improve the quality and interoperability of your applications. In this blog post, I will explain what JSON schemas are, how they work, and why you might need them. Quick Recap - JSON JSON allows us to represent different types of elements. Compared to XML based markup (e.g., HTML) JSON is lightweight, and based on native data structures of JavaScript. For this reason, JSON is widely used by web apps to communicate over networks. Here are some key differences between XML and JSON [Source] . JSON objects have a type, whereas XML data is type-less. JSON does not provide namespace support while XML provides namespaces support. JSON has no display capabilities whereas XML offers the capability to display data. JSON is less secured whereas XML is more secure compared to JSON. JSON supports only UTF-8 enco...

2021-01-22 Twitter rewrites your URLs, but assumes you’ll never rewrite theirs: more problems replaying archived Twitter

Image
Figure 1: The tweet replayed in Internet Archives’s Wayback Machine has the t.co URI-M (“/web/20210106213519/https://t.co/Pm2PKV0Fp3”) displayed in the memento . URLs shared on Twitter are automatically shortened to t.co links . Twitter does this to track its engagements and also protect its users from sites with malicious content. Twitter replaces these t.co URLs with HTML that suggests the original URL so that the end-user does not see the t.co URLs while browsing. When these t.co URLs are replayed through web archives, they are rewritten to an archived URL (URI-M) and should be rendered in the web archives as in the live web, without displaying these t.co URI-Ms to the end-user. However, as shown in Figure 1, the tweet replayed in Internet Archive’s Wayback Machine has the t.co URI-Ms (or at least the relative URL, “/web/20210106213519/https://t.co/Pm2PKV0Fp3”) displayed in the tweet itself.  We first noticed the t.co URL displayed in the memento while exploring the archived Tw...

2020-11-04: New Twitter UI: Replaying Archived Twitter Pages That Never Existed

Image
  Figure 1: Multiple Temporal Violations in an archived page with the new Twitter interface.  When you visit web archives to go back in time and look at a web page, you naturally expect it to display the content exactly as it appeared on the live web at that particular datetime. That is, of course, with the assumption in mind that all of the resources on the page were captured at or near the time of the datetime displayed in the banner for the root HTML page. However, we noticed that it is not always the case and problems with archiving Twitter's new UI can result in replaying Twitter profile pages that never existed on the live web. In our previous blog post , we talked about how difficult it is to archive Twitter's new UI, and in this blog post, we uncover how the new Twitter UI mementos in the Internet Archive are vulnerable to temporal violations . On Aug 18, 2020, we stumbled upon a recently archived memento (Figure 1) of Donald Trump’s Twitter profile page in the Inte...