2014-03-06 28 views
0

我正在使用Stupeflix api开发一个wordpress插件,这个插件使用php。 我必须将它迁移到新的。但是,在stupeflix网站上实际上缺乏解释,并且没有关于如何执行的代码示例。stupeflix使用php和ajax创建简单的任务

我创建了一个帐户来测试它。但似乎我需要注册一个域名。好。但是如果我需要在本地工作呢?

然后我使用任务api。 JSON有点瘦:我如何通过我的其他参数像我的密钥?例如,如果它在源代码中可以清晰地读取,那么该如何保密呢?

Thans您聚光灯:)

PS:我不能计算器创建stupeflix标签。这样的耻辱,stupeflix作者告诉我使用它来获得支持...

+0

尽管我确信stupeflix的作者会喜欢将他的[非免费应用](http://studio.stupeflix.com/en/pricing/)外包给SO,让其他人提供免费支持, [“stupeflix”标签看起来像它从未在SO上使用过](http://stackoverflow.com/tags/)。 –

+0

感谢您的回放,即使它对我没有多大帮助。 这是作者的原始邮件给我: “Nous n'avons pas de community forum,mais vous pouvez poser vos questions directement sur stackoverflow avec un tag”stupeflix“pour que nous puissions les identifier。” 翻译: “我们没有社区论坛,但您可以使用标签”stupeflix“直接在stackoverflow上提问您的问题,以便我们确定他们的身份。 我会感谢一些帮助,确实:) – Neovea

回答

2

新的stupeflix API是一个标准的HTTP API与JSON机构,你可以发送请求任何语言与任何图书馆。每种语言都有一个体面的HTTP请求库,例如在Python中,我推荐python-requests或Jquery.ajax()

这里没有代码示例,但是您有很多JSON examples here

大多数时候,你只需要发送POST请求包含一个或多个任务定义一个JSON身体dragon.stupeflix.com/v2/create:

{ 
    "task_name": "video.create", 
    "definition": "<movie service=\"craftsman-1.0\">\n <body>\n <effect type=\"none\">\n  <video filename=\"http://s3.amazonaws.com/stupeflix-assets/apiusecase/footage.mov\" speed=\"2.0\" audio=\"false\">\n  <filter type=\"colormap\" preset=\"bw\"/>\n  </video>\n </effect>\n </body>\n</movie>" 
} 

Here is the documentation。你会得到一个JSON响应,如下:

{ 
    "status": "executing", 
    "result": { 
    "duration": 10, 
    "preview": "http://dragon.stupeflix.com/storage/flvstreamer/222/LY5XZIPILG6WKKIAGQAB4RLHBY/360p/preview.flv" 
    }, 
    "key": "LY5XZIPILG6WKKIAGQAB4RLHBY", 
    "progress": 10, 
    "events": { 
     "started": "2013-11-16T06:02:55.669278+00:00", 
     "queued": "2013-11-16T06:02:55.667394+00:00" 
    } 
} 

我希望这会有所帮助。

+0

嗨,什么是getenv(“STUPEFLIX_HOST”) – 2plus

+0

我已经尝试过在PHP中。但它不工作 – 2plus