In this blog, we are using Akka-HTTP and the Open Graph protocol to retrieve data from a URL.
Open Graph Protocol
The Open Graph protocol enables any web page to become a rich object in a social graph. For instance, this is used on Facebook to allow any web page to have the same functionality as any other object on Facebook.
While many different technologies and schemas exist and could be combined together, there isn’t a single technology that provides enough information to richly represent any web page within the social graph.
With the help of the Open Graph protocol and Akka-HTTP, I developed a mini project that can retrieve data from a URL, like:
You can find the complete code here.
The build.sbt file of the project contains all dependencies.
UrlMetaDataActor.scala file gets the data from the URL.
Now, let's look at an example of the tool doing its work:
And there you have it! You've pulled metadata from a URL with Scala, Akka-HTTP, and the Open Graph protocol.