小编pol*_*guy的帖子

渐进式 Web 应用程序 - 未检测到清单

我正在构建一个渐进式 Web 应用程序,并且想要添加一个清单文件。我已经构建了一个并在主页上添加了指向它的链接,但我收到一条消息:“未检测到清单”。这是 header 在 index.html 中的样子:

<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="application-name" content="app">
<meta name="apple-mobile-web-app-title" content="app">
<meta name="theme-color" content="#233b69">
<meta name="msapplication-navbutton-color" content="#233b69">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="msapplication-starturl" content="/index.html">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<link rel="icon" type="image/png" sizes="192x192" href="assets/img/app.png">
<link rel="apple-touch-icon" type="image/png" sizes="192x192" href="assets/img/app.png">

<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width">
<meta name="mobile-web-app-capable" content="yes">

<link rel="manifest" href="manifest.json">
Run Code Online (Sandbox Code Playgroud)

Manifest.json 文件如下所示:

{
  "name": "someApp",
  "short_name": "app",
  "lang": "en-US",
  "start_url": "/index.html",
  "display": "standalone",
  "theme_color": "#233b69",
  "icons": [
{
  "src": "assets/img/app.png",
  "sizes": …
Run Code Online (Sandbox Code Playgroud)

html manifest progressive-web-apps

11
推荐指数
1
解决办法
1万
查看次数

AWS Python Lambda函数-将文件上传到S3

我有一个用Python 2.7编写的AWS Lambda函数,我想在其中执行以下操作:

1)从HTTP地址获取一个.xls文件。

2)将其存放在临时位置。

3)将文件存储在S3存储桶中。

我的代码如下:

from __future__ import print_function
import urllib
import datetime 
import boto3
from botocore.client import Config

def lambda_handler(event, context):

    """Make a variable containing the date format based on YYYYYMMDD"""
    cur_dt = datetime.datetime.today().strftime('%Y%m%d')

    """Make a variable containing the url and current date based on the variable
    cur_dt"""
    dls = "http://11.11.111.111/XL/" + cur_dt + ".xlsx"
    urllib.urlretrieve(dls, cur_dt + "test.xls")

    ACCESS_KEY_ID = 'Abcdefg'
    ACCESS_SECRET_KEY = 'hijklmnop+6dKeiAByFluK1R7rngF'
    BUCKET_NAME = 'my-bicket'
    FILE_NAME = cur_dt + "test.xls";

    data = open('/tmp/' + …
Run Code Online (Sandbox Code Playgroud)

amazon-s3 python-2.7 aws-lambda

7
推荐指数
3
解决办法
1万
查看次数

如何使用Google Geocode API和PHP获取用户的当前位置

我创建了一个应用程序,并且作为数据收集的一部分,我想在用户使用php访问应用程序和网站时捕获用户的当前位置.

理想情况下,我希望尽可能简化这一点.目前,我有以下脚本,但它有一个默认地址:

$fullurl = "http://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=true";
echo $json;
$string .= file_get_contents($fullurl); // get json content
$json_a = json_decode($string, true); //json decoder

echo $json_a['results'][0]['geometry']['location']['lat']; // get lat for json
echo $json_a['results'][0]['geometry']['location']['lng']; // get ing for json
Run Code Online (Sandbox Code Playgroud)

我希望用户的当前位置取代1600 Amphitheatre Parkway,Mountain View,CA.

非常感谢任何帮助.

javascript php google-api geolocation reverse-geocoding

4
推荐指数
1
解决办法
2万
查看次数