草庐IT

google-location-services

全部标签

php - 使用google api获取两个位置之间的距离

我有以下代码:$output=file_get_contents("http://maps.google.com/maps/nav?q=from:39.519894,-5.105667%20to:51.129079,1.306925");$distance=json_decode($output);我从GoogleAPI获得JSON响应,但是当我使用json_decode()解码JSON时,我得到一个NULL值,这意味着该函数无法解码这背后的原因是什么? 最佳答案 这应该对你有用,你可以将地址或只是纬度/经度传递给$from&$to

php - OAuth2 token ,消息 : '{ "error": "access_denied" }' returned when I try to update Google Calendar using OAuth (Service Account)

我正在使用适用于PHP的Google标准库来使用日历服务,并且我已经通过GoogleAPI控制台为OAuth2.0身份验证设置了一个服务帐户类型。我的主要目标是通过批量更新用户的谷歌日历(例如:user@organisationname.com)(当用户不在线时)。例如。更新用户日历中的事件。当用户登录应用程序(使用OAuth2.0)时,他/她将为应用程序提供“管理您的日历”、“查看您的日历”和“在我不使用应用”以下代码用于使用OAuth2.0登录setApplicationName("GoogleCalendarPHPStarterApplication");$client->set

php - 是否有可能使用 PHP 获取 Google 网站管理员工具 (GET) 数据?

我正在尝试从Google网站站长工具(GWT)获取一些数据,我已经搜索了一些API文档和工具,但它们仅从GWT返回了一些数据。我的需求:需要从GWT获取以下数据,(1)。TOP_PAGES(2)。TOP_QUERIES(3)。CRAWL_ERRORS(4)。内容错误(5)。CONTENT_KEYWORDS(6)。内部链接(7)。外部链接(8)。社会事件获取这些数据后,我需要为每个数据生成Excel文件。已实现:我从上面得到的数据很少并生成到Excel文件中。例如,(1)。TOP_PAGES(2)。TOP_QUERIES(3)。内部链接(4)。外部链接(5)。CONTENT_KEYWOR

php - Google 图表 - 绘制空值

我创建了一个折线图,它使用php和json加载数据。问题是图表将NULL值绘制为0,看起来非常难看。我最好的猜测是我以错误的方式创建了json,我真正想要的输出是{"v":}而不是{"v":""}。现在的折线图:我想要的:php代码$reports['cols'][]=array(label=>"Time",type=>"string");$reports['cols'][]=array(label=>"Today",type=>"number");$reports['cols'][]=array(label=>"Yesterday",type=>"number");$reports[

php - 无法使用 Google PHP 客户端将内容类型设置为 Google 存储

我正在使用google-api-php-client这是我上传.jpg图片的地方。$postbody=array("data"=>$imgData);$gso=newGoogle_StorageObject();$gso->setName($imageName);$contentType='image/jpg';$gso->setContentType($contentType);$resp=$objects->insert('bucket-name',$gso,$postbody);通过检查$gso正在添加ContentType,但在云控制台中添加了默认的application/oc

php - Google Cloud Storage 上传错误 - strpos() : Empty needle

将文件上传到GoogleCloudStorage时(通过我在AppEngine上运行的应用程序)我收到以下PHP警告Warning:strpos():Emptyneedlein/base/data/home/runtimes/php/sdk/google/appengine/ext/cloud_storage_streams/CloudStorageStreamWrapper.phponline168我用过按照官方指南,然后做了一个基本的Action$gs_name=$_FILES["uploaded_files"]['tmp_name'];move_uploaded_file($gs

php - 使用 curl 从 Google Places API Place Photos 保存照片副本

我正在尝试使用curl从GooglePlacePhotos抓取照片并将其保存在我的服务器上。请求格式符合GoogleAPIdocumentation是这样的:https://maps.googleapis.com/maps/api/place/photo?maxwidth=400&photoreference=CoQBegAAAFg5U0y-iQEtUVMfqw4KpXYe60QwJC-wl59NZlcaxSQZNgAhGrjmUKD2NkXatfQF1QRap-PQCx3kMfsKQCcxtkZqQ&sensor=true&key=AddYourOwnKeyHere所以我尝试了这个功

php - Google Calendar API PHP 通知到期值

我正在使用PHP成功注册GoogleCalendarAPI更改通知:$service=newGoogle_Service_Calendar($client);$channel=newGoogle_Service_Calendar_Channel($service);$channel->setId();$channel->setType('web_hook');$channel->setAddress('https://www.myserver.net/triggerCode.php');$timetoExpire=time()+3600000;$channel->setExpirati

php - nginx: [emerg] "location"指令在/etc/nginx/conf.d/default.conf:1 中不允许

我刚开始在AWSAMI实例上使用Nginx,但遇到了一些启动问题。我已点击此链接安装php-fpm和nginxhttps://gist.github.com/sumardi/5559803除了,我不需要mysql,所以我没有运行这个命令sudoyum-yinstallmysql-servermysql我的/etc/nginx/conf.d/default.conf看起来像这样:location/{root/var/www/html;indexindex.phpindex.htmlindex.htm;}location~\.php${fastcgi_passunix:/var/run/p

php - file_put_contents(.../bootstrap/cache/services.json) : failed to open stream: No such file or directory

我在运行任何phpartisan命令时一直收到此错误。[ErrorException]file_put_contents(/Applications/MAMP/htdocs/code/bheng/md-bheng/bootstrap/cache/services.json):failedtoopenstream:Nosuchfileordirectory我该如何阻止它? 最佳答案 编辑-如果services.json文件不存在,运行phpartisanserve然后停止强制创建文件。请参阅:laravelservices.jsonn