sthewissen/MVP

[Feature] OpenGraph-based pre-filling

sthewissen opened this issue · 3 comments

  • When the user hits the add button the app can check the clipboard for a URL.
  • If there is a URL, ask the user if it should be used to prefill some of the fields.
  • If answered with yes we can prefill:
    • URL
    • Title (using OpenGraph we can get the page title)
    • Publication date
    • Description

Here's some sample OG data from a blogpost on my site:

<meta property="og:locale" content="en_US" />
<meta property="og:type" content="article" />
<meta property="og:title" content="Playing with animation in Xamarin.Forms" />
<meta property="og:description" content="Movement breathes life into your app. Getting started with animation in Xamarin.Forms might not be the simplest thing so let&#039;s implement some animations!" />
<meta property="og:url" content="https://www.thewissen.io/playing-with-animation-in-xamarin-forms/" />
<meta property="og:site_name" content="Steven Thewissen: Mobile Developer from the Netherlands" />
<meta property="og:updated_time" content="2020-04-20T09:39:13+00:00" />
<meta property="og:image" content="https://www.thewissen.io/wp-content/uploads/animation.jpg" />
<meta property="og:image:secure_url" content="https://www.thewissen.io/wp-content/uploads/animation.jpg" />
<meta property="og:image:width" content="1920" />
<meta property="og:image:height" content="700" />

Actual parsing code for a URL to an OpenGraph representing object is in. This can be used in a few locations:

  • When app is resumed and a URL is spotted on the clipboard: ask to make a contribution out of it
  • When a URL is entered for an activity: grab the OG data and display a small preview (like Twitter, FB do)
  • Show the OG image in list view / detail view

When app is resumed and a URL is spotted on the clipboard: ask to make a contribution out of it

This is done.

When a URL is entered for an activity: grab the OG data and display a small preview (like Twitter, FB do)

Also done.

Removed the one on resume, left the one on adding a contribution. This works now and is getting closed 🎉