SiteSummary

Current version: 0.2

What is SiteSummary?

SiteSummary is a service that lets you:

  • get basic information about a website
  • build useful tools such as social media dashboards and browser bookmarklets
  • show number of online shares without the technical debt of the official widgets

You can also use the documentation to learn how to fetch this data yourself.

How do I use it?

You have a few options:

  • Calling https://fourtonfish.com/sitesummary?url=[URL] will return the basic information about the site

{
	"url": "http://simplesharingbuttons.com/",
	"title": "Simple Sharing Buttons Generator",
	"description": "Share to Facebook, Twitter, Google+ and other social networks using simple HTML buttons",
	"image": "http://simplesharingbuttons.com/simple-sharing-buttons-generator/images/preview.png",
	"twitter": "@fourtonfish"
}
  • You can also ask for social data (number of shares, likes, etc) by calling http://fourtonfish.com/sitesummary?url=[URL]&social=true
    or https://fourtonfish.com/sitesummary?url=[URL]&social=all

{
	"url": "http://simplesharingbuttons.com/",
	"title": "Simple Sharing Buttons Generator",
	"description": "Share to Facebook, Twitter, Google+ and other social networks using simple HTML buttons",
	"image": "http://simplesharingbuttons.com/simple-sharing-buttons-generator/images/preview.png",
	"twitter": "@fourtonfish"
	"social": {
		"facebook": {
			"shared": 51,
			"liked": 43,
			"total": 99,
			"comments": 5
		},
		"twitter": {
			"tweets": 131
			},
		"googleplus": {
			"plusones": 19
			},
		"pinterest": {
			"pins": 4
			},
		"stumbleupon": {
			"views": 0
		},
		"reddit": {
			"score": 80,
			"comments": 28
		},
		"linkedin": {
			"shared": 6
			},
		"total": 258
	}
}
  • If you want to easily iterate through the returned social data, you can request it in a flat structure: https://fourtonfish.com/sitesummary?url=[URL]&social=all&flat=true (note that this will not return the total)

{
	"url": "http://simplesharingbuttons.com/",
	"title": "Simple Sharing Buttons Generator",
	"description": "Share to Facebook, Twitter, Google+ and other social networks using simple HTML buttons",
	"image": "http://simplesharingbuttons.com/simple-sharing-buttons-generator/images/preview.png",
	"twitter": "@fourtonfish",
	"social": {
		"facebook": 99,
		"facebook-liked": 43,
		"facebook-shared": 51,
		"facebook-comments": 5,
		"twitter": 131,
		"googleplus": 19,
		"pinterest": 4,
		"stumbleupon": 0,
		"reddit": 80,
		"reddit-comments": 28,
		"linkedin": 6
	}
}
  • You can also request data for specific networks: https://fourtonfish.com/sitesummary?url=[URL]&social=facebook,twitter,pinterest

{
	url: "http://simplesharingbuttons.com/",
	title: "Simple Sharing Buttons Generator",
	image: "http://simplesharingbuttons.com/simple-sharing-buttons-generator/images/preview.png",
	twitter: "@fourtonfish",
	social: {
		facebook: {
			shared: 55,
			liked: 43,
			total: 103,
			comments: 5
		},
		twitter: {
			tweets: 131
		},
		pinterest: {
			pins: 4
		},
		total: 238
	}
}

Supported networks are:

  • Google+ -- social=googleplus or social=google_plus
  • LinkedIn -- social=linkedin
  • Pinterest -- social=pinterest
  • Reddit -- social=reddit
  • StumbleUpon -- social=stumbleupon

(See note on deprecated networks.) The total will only include the total number of social interactions for specified networks.

How does it work?

  • To get the title and description of the page, SiteSummary will look for
    • the Open Graph data
    • Twitter's own markup
    • if the above fails, it simply gets the necessary tags from HTML of the page
  • The image can only be obtained from the Open Graph or Twitter data
  • Author's Twitter handle can only be read from Twitter's markup

Note: if any of the attributes are not found, they will not be returned.

For social data, most websites provide a URL endpoint you can query.

  • Pinterest: http://api.pinterest.com/v1/urls/count.json?url=[URL]1
  • LinkedIn: http://www.linkedin.com/countserv/count/share?url=[URL]2
  • StumbleUpon: http://www.stumbleupon.com/services/1.01/badge.getinfo?url=
  • Reddit: http://buttons.reddit.com/button_info.json?url=[URL]3

Notes:

  • 1, 2 Pinterest and Linked return JSONP. Furthermore, it seems Pinterest's endpoint can change or be disabled in the future
  • 3 Reddit recently removed the display of downvotes, so only the total score and number of comments will be returned.

Google+ is a bit tricky. They do have an endpoint at https://plusone.google.com/_/+1/fastbutton?url=[URL]&count=true, but this returns the actual HTML for the +1 button. You will have to get the number of +1s from the code -- and you should use the script tag, because for sites with large amount of +1s the displayed number will show, for example, 25k instead of 25,302.

Depreciation notices

Endpoints that have been deprecated.

  • Twitter: http://urls.api.twitter.com/1/urls/count.json?url=
  • Facebook: https://api.facebook.com/method/links.getStats?urls=[URL]&format=json

Anything else I should know?

Under the hood, SiteSummary is running on Python and Flask and most of the work is done by BeautifulSoup.

Originally I used it as an internal service powering the Simple Sharing Buttons Generator. It should work well for most sites, although I came across larger sites that had small issues. If you come across a site that doesn't seem to work, please send me a link to stefan@fourtonfish.com.

SiteSummary is pretty much in alpha. As I don't expect a lot of traffic, the service is free and no registration/API keys are required. You can easily implement your own service using the documentation above.

Also, feel free to follow me on Twitter for updates.

Version history

0.2

  • Twitter and Facebook endpoints deprecated

0.1

  • first release
Back to top