Skip to content

getWebPagePreview

Sahri Riza Umami edited this page Jul 1, 2018 · 5 revisions

Returns a web page preview by the text of the message.
Do not call this function too often.
Returns a 404 error if the web page has no preview.

getWebPagePreview(text, callback, data)
Field Type Description
message_text string Message text with formatting.

Example

  • Get web page preview by text of the message.

    getWebPagePreview('http://m.gsmarena.com/xiaomi_google_android_one-news-26847.php')

    Response:

    {
      ["@type"] = "webPage",
      author = "",
      description = "The Xiaomi Mi 5X might arrive in Indonesia with stock Android and an even lower price.",
      display_url = "gsmarena.com/xiaomi_google_android_one-news-26847.php",
      duration = 0,
      embed_height = 0,
      embed_type = "",
      embed_url = "",
      embed_width = 0,
      has_instant_view = false,
      photo = {
        ["@type"] = "photo",
        has_stickers = false,
        id = "532578423356850363",
        sizes = {
          {
            ["@type"] = "photoSize",
            height = 39,
            photo = {
              ["@type"] = "file",
              expected_size = 985,
              id = 5,
              ["local"] = {
                ["@type"] = "localFile",
                can_be_deleted = false,
                can_be_downloaded = true,
                downloaded_prefix_size = 0,
                downloaded_size = 0,
                is_downloading_active = false,
                is_downloading_completed = false,
                path = ""
              },
              remote = {
                ["@type"] = "remoteFile",
                id = "AgADBAADuwABORtBGWQHWX7k-QNYAmSnQmMwAASpmNv3MtzPUDW3AAIC",
                is_uploading_active = false,
                is_uploading_completed = true,
                uploaded_size = 985
              },
              size = 985
            },
            type = "s",
            width = 90
          },
          {
            ["@type"] = "photoSize",
            height = 138,
            photo = {
              ["@type"] = "file",
              expected_size = 10941,
              id = 6,
              ["local"] = {
                ["@type"] = "localFile",
                can_be_deleted = false,
                can_be_downloaded = true,
                downloaded_prefix_size = 0,
                downloaded_size = 0,
                is_downloading_active = false,
                is_downloading_completed = false,
                path = ""
              },
              remote = {
                ["@type"] = "remoteFile",
                id = "AgADBAADuwABORtBGWQHWX7k-QNYAmSnQmMwAARvg5okahhtwza3AAIC",
                is_uploading_active = false,
                is_uploading_completed = true,
                uploaded_size = 10941
              },
              size = 10941
            },
            type = "m",
            width = 320
          },
          {
            ["@type"] = "photoSize",
            height = 314,
            photo = {
              ["@type"] = "file",
              expected_size = 52926,
              id = 7,
              ["local"] = {
                ["@type"] = "localFile",
                can_be_deleted = false,
                can_be_downloaded = true,
                downloaded_prefix_size = 0,
                downloaded_size = 0,
                is_downloading_active = false,
                is_downloading_completed = false,
                path = ""
              },
              remote = {
                ["@type"] = "remoteFile",
                id = "AgADBAADuwABORtBGWQHWX7k-QNYAmSnQmMwAAQfxj5nYRuW7Te3AAIC",
                is_uploading_active = false,
                is_uploading_completed = true,
                uploaded_size = 52926
              },
              size = 52926
            },
            type = "x",
            width = 728
          }
        }
      },
      site_name = "GSMArena.com",
      title = "Xiaomi working with Google on next Android One smartphone",
      type = "article",
      url = "http://m.gsmarena.com/xiaomi_google_android_one-news-26847.php"
    }

Frequently Asked Questions
The Functions

Clone this wiki locally