标签: posting

如何使用ACAccountStore类在Objective-C中在iOS 6上发布到Facebook

我想知道如何使用Xcode 4.5上的新框架在iOS 6上向Facebook发布状态消息.谢谢!:)

xcode frameworks facebook posting ios6

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

连接didReceiveData在iphone中发布Url时调用了两次?

我是iphone开发的新手.我发布了带有用户名和密码的URL.我能够在"连接didReceiveData"方法中打印数据.但是我看到"连接didReceiveData"方法被调用了两次.我不知道,我哪里出错了.这是我的代码

 - (void)viewDidLoad {
[super viewDidLoad];

NSString *post = [NSString stringWithFormat:@"&domain=school.edu&userType=2&referrer=http://apps.school.edu/navigator/index.jsp&username=%@&password=%@",@"xxxxxxx",@"xxxxxx"];

NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];

NSString *postLength = [NSString stringWithFormat:@"%d",[postData length]];

NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];

[request setURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://secure.school.edu/login/process.do"]]];

[request setHTTPMethod:@"POST"];

[request setValue:postLength forHTTPHeaderField:@"Content-Length"];

[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Current-Type"];

[request setHTTPBody:postData];

NSURLConnection *conn = [[NSURLConnection alloc]initWithRequest:request delegate:self];

if(conn)
{
    NSLog(@"Connection Successful");

}
else
{
    NSLog(@"Connection could not be made");
}

    }

 - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData*)data{

NSString *string = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
NSLog(@"the  data %@",string);
  }
Run Code Online (Sandbox Code Playgroud)

整个HTML页面在控制台中打印两次.所以请帮帮我.谢谢.

iphone url posting

11
推荐指数
2
解决办法
4336
查看次数

使用ajax将数组发布到PHP

我在使用AJAX将数组发布到PHP页面时遇到问题.我一直在用这个问题作为指导,但无论出于何种原因,我仍然无法让它发挥作用.从我可以通过使用告诉我print_r($_POST),我发布一个空数组,但在HTML/Javascript页面上,我使用警报来查看数组已被填充.该帖子正在工作,因为它在帖子上将空白值输入到MySQL数据库中,但我无法弄清楚它为什么传递空数组.代码如下:

使用Javascript:

<script type="text/javascript">
    var routeID = "testRoute";
    var custID = "testCustID";
    var stopnumber = "teststopnumber";
    var customer = "testCustomer";
    var lat = 10;
    var lng = 20;
    var timeStamp = "00:00:00";


    var dataArray = new Array(7);
  dataArray[0]= "routeID:" + routeID;
  dataArray[1]= "custID:" + custID;
  dataArray[2]= "stopnumber:" + stopnumber;
  dataArray[3]= "customer:" + customer;
  dataArray[4]= "latitude:" + lat;
  dataArray[5]= "longitude:" + lng; 
  dataArray[6]= "timestamp:" + timeStamp; 
  var jsonString = JSON.stringify(dataArray);
  function postData(){
    $.ajax({
       type: "POST",
       url: "AddtoDatabase.php", …
Run Code Online (Sandbox Code Playgroud)

javascript php arrays posting

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

在Android中集成Google Plus时,SERVICE_VERSION_UPDATE_REQUIRED和Google Play服务已过期

我在Android App中集成了Google Plus.我使用的是Android SDK版本4.2.2.但是我在google plus上执行共享帖时遇到了这个错误:

Google Plus服务已过期

ConnectionResult {statusCode = SERVICE_VERSION_UPDATE_REQUIRED,resolution = null}

我想在模拟器上运行Google Plus发布,而不是在设备上运行.

任何帮助将不胜感激.

android posting google-plus google-play-services

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

使用jwordpress在WordPress中发布帖子

我正在使用jwordpress-0.4.jar发布到WordPress安装.

我使用的代码是:

Wordpress wp = new Wordpress(username, password, xmlRpcUrl);
Page recentPost = new Page();
recentPost.setPost_status("Published");
recentPost.setDescription("<ul>" + desc + "</ul>");
recentPost.setCategories(cat);
String pageID=recentPost.getPage_id();
String result = wp.newPost(recentPost, true);
Run Code Online (Sandbox Code Playgroud)

这之前运作良好,但现在当我去发布它进入其调度模式时,我尝试过:

recentPost.setPost_status( "发布时间");

wp.​​newPost(recentPost,true);

但这篇文章仍未发表:

java wordpress posting

6
推荐指数
1
解决办法
1225
查看次数

使用oAuth和C#在Tumblr上发布

我正在尝试使用v2 API开发一个与Tumblr交互的简单应用程序.我能够通过oAuth流程中的每一步(感谢Twitter上的文档)并获得授权和认证的令牌和秘密.但是在发布时,我收到了401未经授权的错误.这是相关的代码段:

    private void post_Click(object sender, System.Windows.RoutedEventArgs e)
    {
        url = new Uri("http://api.tumblr.com/v2/blog/*myblog*.tumblr.com/post");

        Random random = new Random();
        nonce = random.Next(1234000, 9999999).ToString();

        TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0);
        timestamp = Convert.ToInt64(ts.TotalSeconds).ToString();

        string method = "POST";

        StringBuilder sb = new StringBuilder();
        sb.AppendFormat("{0}&", method);
        sb.AppendFormat("{0}&", upperCaseUrl(HttpUtility.UrlEncode(url.ToString())));
        sb.AppendFormat("body%3D{0}%26", upperCaseUrl(HttpUtility.UrlEncode(textBox.Text)));
        sb.AppendFormat("oauth_consumer_key%3D{0}%26", consumerKey);
        sb.AppendFormat("oauth_nonce%3D{0}%26", nonce);
        sb.AppendFormat("oauth_signature_method%3D{0}%26", "HMAC-SHA1");
        sb.AppendFormat("oauth_timestamp%3D{0}%26", timestamp);
        sb.AppendFormat("oauth_token%3D{0}%26", token);
        sb.AppendFormat("oauth_version%3D{0}%26", "1.0");
        sb.AppendFormat("type%3D{0}", "text");

        System.Diagnostics.Debug.WriteLine(sb.ToString());

        string signingKey = consumerSecret + '&' + secret;

        HMACSHA1 signing = new …
Run Code Online (Sandbox Code Playgroud)

c# text oauth tumblr posting

6
推荐指数
1
解决办法
3406
查看次数

根据单击的按钮将相同的表单发布到不同的操作

我在StackOverflow上有类似的帖子,但也许我的误解更为重要.我有一个动作索引()和索引视图的渲染.从Index()视图取决于单击的按钮[HttpPost]索引()或[HttpPost] Search()必须被调用因为我发布了一些数据.发布到不同操作的唯一方法是使用jQuery吗?如果jQuery是唯一的方法,如果我的操作返回视图(完整的Html页面),我必须从$ .post清理整个文档元素并用我的视图html填充它?我对这一切都很陌生,非常感谢!

@using (Html.BeginForm())
{
    <input name="startDate" type="text" size="20" class="inputfield" id="datepicker" />
    <a href="#" id="apply_button">...</a>
    <a href="#" id="go_button">...</a>
}


public ActionResult Index(string lang)
{
    return View();
}

//Perhaps this action is needed
[HttpPost]
public ActionResult Index(string lang, string startDate)
{
    return View();
}

[HttpPost]
public ActionResult Search(string lang, string startDate)
{
    return View();
]
Run Code Online (Sandbox Code Playgroud)

javascript asp.net-mvc jquery posting

5
推荐指数
1
解决办法
4179
查看次数

facebook可以动态创建图形对象吗?

我正在开发一个facebook应用程序.我在打开的图表中创建了一个自定义对象,下面列出的是我的一些顾虑

  1. 特定对象类型下的每个对象实例都需要一个唯一的网页吗?
  2. 我使用JS SDK发布开放图形动作,是否有任何规则,我在js函数中使用对象url(下面代码中的"myobjectrul"),例如:

FB.api('/ me/myapp:myaction'+'?myobject = myobjecturl&access_token = myaccessToken','post',{scrape:true},

         function (response) {
             var msg = 'Error occured';
             if (!response || response.error) {
                 if (response.error) {
                     msg += "\n\nType: " + response.error.type + "\n\nMessage: " + response.error.message;
                 } alert(msg);
             } else {
                 alert('Post was successful! Action ID: ' + response.id);
             }
         });
Run Code Online (Sandbox Code Playgroud)

应该与对象中元标记中的og:url相同?

  1. 我们可以传递任何查询字符串以及可以在对象页面中检索的对象URL吗?

  2. 我们如何发布具有不同对象属性的相同对象类型(例如,不同的图像,不同的URL等)

任何帮助是极大的赞赏.

action facebook dynamic posting facebook-opengraph

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

复选框没有在PHP中发布

所以我试图从以后将被发送到数据库的3个复选框中获取值,但由于某些原因,在进行测试时它们不会在PHP中发布.

<table width="200" border="0">
 <tr>
  <td><img src="images/image1.jpg" ></td>
  <td><img src="images/image2.jpg" ></td>
  <td><img src="images/image3.jpg" ></td>
 </tr>
 <tr>
  <td><input type="checkbox" id="checkbox65" class="css-checkbox med"     name="avatar" value="image1"/>
   <label for="checkbox65" class="css-label med elegant" /></label></td>
  <td><input type="checkbox" id="checkbox66" class="css-checkbox med" name="avatar" value="image2"/>
   <label for="checkbox66" class="css-label med elegant" /></label></td>
  <td><input type="checkbox" id="checkbox67" class="css-checkbox med" name="avatar" value="image3"/>
   <label for="checkbox67" class="css-label med elegant"  ></label></td>
  </tr>
 </table><br>
Run Code Online (Sandbox Code Playgroud)

我在另一页面发帖:

<?php 
if(isset($_POST['submit'])){$avatar=$_POST['avatar'];} 
echo $avatar; ?>
Run Code Online (Sandbox Code Playgroud)

但我得到了

 Undefined index: avatar on line 14
Run Code Online (Sandbox Code Playgroud)

我有表格标签,一切都是正确的,这是一个不同的问题,页面上的其他所有内容都正确发布,除了这一件事

php checkbox posting

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

使用Facebook android SDK发布到Facebook特定的朋友列表

我成功发布到Facebook墙,但我希望用户可以选择是否要将其发布到某些特定的朋友列表,例如熟人,家庭等

我的代码给出了这个错误:

{"error":{"message":"(#100) privacy must contains a valid privacy 'value'","type":"OAuthException"}}
Run Code Online (Sandbox Code Playgroud)

我添加了"隐私"属性并赋予它"家庭"的价值,但它不起作用,但是如果我删除了隐私属性,那么墙贴就成功了

try
        {
            Bundle parameters = new Bundle();
            parameters.putString("message", msg);
            parameters.putString("description", "Test 1");
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("value", "Family");
            parameters.putString("privacy", jsonObject.toString());
            response = Data.facebook.request("me/feed", parameters,"POST");

        } catch(Exception e) {
            e.printStackTrace();
        }
Run Code Online (Sandbox Code Playgroud)

android privacy posting facebook-graph-api

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

查找唯一可见的<div>,其中包含动态<ul>并返回<ul> id

我有一堆动态标签(div),例如:

<div id="collection">

  <div id="tab-1">
    <ul id="sortable-tab-1">
      <li>
      </li>
    </ul>
  </div>

  <div id="tab-2" class="hidden">
    <ul id="sortable-tab-2">
      <li>
      </li>
    </ul>
  </div>
  .... etc ...
</div>
Run Code Online (Sandbox Code Playgroud)

我正在寻找最好的方法来找出使用jquery可见的哪个标签(div).由于标签是动态的,我不知道id,但我知道哪个div是隐藏的,因此留下一个可见的div.

我需要以某种方式找到UL ID可见的div然后返回UL标识.所以我留下了'sortable-tab-1'作为我的结果.

基本上我需要知道选择了哪个选项卡,这样我就可以发布正确的可排序列表.

JavaScript给了我一个头痛!

谁能帮忙.谢谢.

jquery list selected jquery-ui-sortable posting

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