小编Unr*_*ity的帖子

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

Twitter API - >使用php更新配置文件bg图像

到目前为止,我一直在尝试使用php更新twitter配置文件bg图像,并且没有成功

网上有很多例子,包括这一个:
通过API更新Twitter背景,
以及这个
带有API和多表格数据的Twitter背景上传
根本不起作用,大多数人在没有实际测试代码的情况下抛出答案.

我发现直接将图像提交到twitter.com的thr html表单,它会起作用:

<form action="http://twitter.com/account/update_profile_background_image.xml" enctype="multipart/form-data" method="post">
    File: <input type="file" name="image" /><br/>
    <input type="submit" value="upload bg">
</form>
Run Code Online (Sandbox Code Playgroud)

(虽然浏览器会提示您输入Twitter帐户的用户名和密码)

但是,如果我想用php进行相同的处理,它就会失败

<?php
if( isset($_POST["submit"]) ) {

    $target_path = "";
    $target_path = $target_path . basename( $_FILES['myfile']['name']); 

    if(move_uploaded_file($_FILES['myfile']['tmp_name'], $target_path)) {
        // "The file ".  basename( $_FILES['myfile']['name']). " has been uploaded<br/>";
    } else{
        // "There was an error uploading the file, please try again!<br/>";
    }

    $ch = curl_init('http://twitter.com/account/update_profile_background_image.xml');
    curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
    curl_setopt($ch, CURLOPT_USERPWD, $_POST['name'] . ':' . $_POST['pass']);
    curl_setopt($ch, CURLOPT_HTTPHEADER, …
Run Code Online (Sandbox Code Playgroud)

php twitter upload

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

如何在Facebook应用程序中全屏闪光?

Farmvilli可以全屏显示.HappyIsland可以全屏.

但是在facebook应用程序中启用flash全屏幕的诀窍是什么?

flash facebook fullscreen

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

是什么让许多编码网站将标准"转换为非标准"?

这个问题是关于标准双引号"和非标准双引号 "& "

昨天,当我搜索一些示例facebook serverfbml代码,并发现了这一点

http://mahmudahsan.wordpress.com/2008/11/22/facebook-fbml-rendering-in-iframe-application/

好吧所以它有我想要的东西,所以我将代码复制到我的项目中并运行它... bah ...很多错误

为什么?因为该网站将标准双引号"在他的脚本中"变为 "",或者从'进入'单引号

这不是我第一次在从互联网上复制代码时遇到这个问题,我相信许多代码编写者都没想到该网站将他们的单/双引号变成了奇怪的引号.

对这种奇怪现象的解释是什么?

编辑:我注意到标题转换为"进入""太......让我编辑它...哦,我失败了

encoding smart-quotes

0
推荐指数
1
解决办法
141
查看次数