Visualizing archived URLs¶
You can output a static image that pops out headlines, stories and images on the page using the ArchivedURL.write_overlay_to_directory method available on all ArchivedURL() objects.
obj = storytracker.archive("http://www.cnn.com") obj.write_overlay_to_directory("/home/ben/Desktop")
The resulting image is sized at the same width and height of the real page. Images have a red stroke around them. Hyperlinks the system thinks link to stories have a purple border. The rest of the links go blue.
You can output an abstract image visualizing where headlines, stories and images are on the page using the ArchivedURL.write_illustration_to_directory method available on all ArchivedURL() objects. The following code will write a new image of the CNN homepage to my desktop.
obj = storytracker.archive("http://www.cnn.com") obj.write_illustration_to_directory("/home/ben/Desktop")
The resulting image is sized at the same width and height of the real page, with images colored red. Hyperlinks are colored in too. If our system thinks the link leads to a news story, it’s filled in purple. Otherwise it’s colored blue.
Animation that tracks hyperlink’s movement¶
You can create an animated GIF that shows how a particular hyperlink’s position shifted across a series of pages with the following code.
>>> href_to_track = "https://web.archive.org/news/world-africa-25561753" >>> output_dir = "./docs/_static/example/" >> urlset.write_href_overlay_animation_to_directory(href_to_track, output_dir)