Determine Object_ID of a URL to use with the Facebook Open Graph

后端 未结 1 612
春和景丽
春和景丽 2021-02-03 15:08

I am trying to learn how to use the Facebook Open Graph API and have a question on how to determine the object_id of my site. I need this object_id so that I can do other queri

1条回答
  •  野的像风
    2021-02-03 15:39

    Most likely the url should be identical to the og:url meta tag if used on your website. Also you need to append the http:// part for it to work. For example this would work:

    SELECT url,site,id 
    FROM object_url 
    WHERE url IN ( 
        'http://developers.facebook.com',
        'http://www.imdb.com/'
    )
    

    Result:

    [
      {
        "url": "http://developers.facebook.com",
        "site": "developers.facebook.com",
        "id": 113167538713703
      },
      {
        "url": "http://www.imdb.com/",
        "site": "www.imdb.com",
        "id": 6903354771
      }
    ]
    

    But this doesn't:

    SELECT url,site,id 
    FROM object_url 
    WHERE url IN ( 
        'developers.facebook.com',
        'www.imdb.com/'
    )
    

    0 讨论(0)
提交回复
热议问题