Facebook Graph API 中用于定位的国家和城市列表 [英] List of countries and cities to be used in Facebook Graph API for targeting

查看:32
本文介绍了Facebook Graph API 中用于定位的国家和城市列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找发布目标帖子时可与 Facebook Graph API 一起使用的国家/州/城市列表.

I am looking for a list of countries/states/cities that can be used with Facebook Graph API when publishing targeted posts.

我在 this 页面上找到了一个 JSON 文件,但是文件解析不正确,我也怀疑它是否可以用于帖子定位,因为该文件用于广告.

I found one JSON file available on this page but the file doesn't parse correctly and I also doubt whether it can be used for post targeting since the file is for advertisements.

另外,我不确定MaxMind提供的提供的第三方数据是否可以可直接与 Facebook API 一起使用.

Also, I am not sure whether the third party data like the one provided by MaxMind can be used directly with Facebook API.

有没有人有这样的清单,或者至少可以为我指明正确的方向?

Does anyone have such a list or can atleast point me to a right direction?

推荐答案

好的.我能够使用我在问题中 提到 的相同 JSON 文件.正如我在回复@offbysome 时所说,之前我通过在 Google Chrome 中打开文件来保存文件.但后来我使用 Firefox 并使用右键单击 => 将文件另存为选项将文件保存在磁盘上.该文件实际上是一个 tar gz(facebook 错误地将其命名为 .php 文件).解压缩文件后,我可以使用评论中发布的相同代码来获取 PHP 数组,然后将其导入 MySQL.

Ok. I was able to use the same JSON file I mentioned in my question. As I said in my response to @offbysome, previously I had saved the file by opening it in Google Chrome. But then I used Firefox and used the Right Click => Save File As option to save the file on disk. This file is actually a tar gz (which facebook wrongly names as .php file). After unzipping the file, I was able to use the same code posted in my comment to get the PHP array which I then imported to MySQL.

这篇关于Facebook Graph API 中用于定位的国家和城市列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆