DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Data Engineering
  3. Data
  4. Retrieving Data Using Akka-HTTP, Open Graph, and Scala

Retrieving Data Using Akka-HTTP, Open Graph, and Scala

Using standard Scala with the AKKA-HTTP library you can retrieve any metadata and open graph data — useful for cleanly parsing web pages and getting content provider annotated data.

Dhirendra Kumar Kashyap user avatar by
Dhirendra Kumar Kashyap
·
Nov. 25, 16 · Tutorial
Like (2)
Save
Tweet
Share
6.51K Views

Join the DZone community and get the full member experience.

Join For Free

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:

1. https://www.youtube.com/

2. https://soundcloud.com/stream

you can find the complete code here .

the build.sbt file of the project contains all dependencies.

image title

the urlmetadataactor.scala file gets the data from the url.

image title

now, let's look at an example of the tool doing its work:

image title

and there you have it! you've pulled metadata from a url with scala, akka-http, and the open graph protocol.

resources

  • open graph protocol
  • akka http

thanks!

Graph (Unix) Data (computing) Scala (programming language)

Published at DZone with permission of Dhirendra Kumar Kashyap, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How Observability Is Redefining Developer Roles
  • Upgrade Guide To Spring Data Elasticsearch 5.0
  • Microservices Discovery With Eureka
  • What Was the Question Again, ChatGPT?

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: