Skip to content

Latest commit

 

History

History
134 lines (104 loc) · 3.71 KB

README.md

File metadata and controls

134 lines (104 loc) · 3.71 KB

Example of operating oghref_cmd command

This examples will list three functional subcommands which are info, media and json along with execution result and documentations of output (for json subcommand only).

In this example, it will refer to metadata found in official Flutter website.

Get metadata info

oghref_cmd info https://flutter.dev
Data found using og:
┌──────────┐
│og context│
└────┬─────┘
     ├── title: Flutter - Build apps for any screen
     ├── description: Flutter transforms the entire app development process. Build, test, and deploy beautiful mobile, web
     │                , desktop, and embedded apps from a single codebase.
     └── url: //flutter.dev/

Media summary:
Category  Counts
Images:   1



Get media information in metadata

oghref_cmd media https://flutter.dev
Media found in og:
┌──────┐
│Images│
└──┬───┘
   └── 0
       └── url: https://storage.googleapis.com/cms-storage-bucket/70760bf1e88b184bb1bc.png

Export metadata into JSON format (with indent)

oghref_cmd json --indent=4 https://flutter.dev
{
    "og": {
        "site_name": null,
        "title": "Flutter - Build apps for any screen",
        "description": "Flutter transforms the entire app development process. Build, test, and deploy beautiful mobile, web, desktop, and embedded apps from a single codebase.",
        "url": "//flutter.dev/",
        "images": [
            {
                "url": "https://storage.googleapis.com/cms-storage-bucket/70760bf1e88b184bb1bc.png",
                "secure_url": null,
                "type": null,
                "width": null,
                "height": null,
                "alt": null
            }
        ],
        "videos": [],
        "audios": []
    }
}

Documentation of JSON output

(Root object)

Name Type Description
(Name of protocol prefix) MetaInfo Contains metadta information found in specific protocol

MetaInfo

Important

All type are nullable

Name Type Description
site_name string Name of website
title string Title of webpage
description string Explain the website information briefly
url string URL of this website
images list A list of image information obtained
videos list A list of video information obtained
audios list A list of audio information obtained

ImageInfo

Important

All type are nullable, but all nulled values in ImageInfo is forbidden.

Name Type Description
url string URL of image resources
secure_url string URL of image resources which uses HTTPS strictly
type string MIME type of resources
width number Width of the image
height number Height of the image
alt string A sematic message of describing image content in textual

VideoInfo

Important

All type are nullable, but all nulled values in VideoInfo is forbidden.

Name Type Description
url string URL of video resources
secure_url string URL of video resources which uses HTTPS strictly
type string MIME type of resources
width number Width of the video
height number Height of the video

AudioInfo

Important

All type are nullable, but all nulled values in AudioInfo is forbidden.

Name Type Description
url string URL of audio resources
secure_url string URL of audio resources which uses HTTPS strictly
type string MIME type of resources