简体   繁体   English

在 facebook 墙上发布,无需浏览器即可获得离线权限

[英]Posting on facebook wall with offline permission without browser

I'm developing a facebook application that post on the user wall with offline permission guaranteed.我正在开发一个 facebook 应用程序,该应用程序在保证离线权限的情况下发布在用户墙上。 I'm using PHP with the facebook api (this code is in "index.php"):我将 PHP 与 facebook api 一起使用(此代码在“index.php”中):

$user = $_GET['user'];
(if(isset($_GET['publish'])) {
    $attachment = array(
                    'message' => "My message", 
                    'link'    => "http://...",
                    'picture' => 'my_url_picture',
                    'name'    => "link_name",
                    'caption' => 'my_caption',
                    'description'=> 'my_description'
                    );
    $publishStream = $facebook->api("/$user/feed", 'post', $attachment);
}

Now, I use a Java servlet that, when an event occurs, has to post on the user wall in this way:现在,我使用 Java servlet,当事件发生时,必须以这种方式在用户墙上发布:

if(event) {
  Runtime rt = Runtime.getRuntime();
  String url_post = "http://apps.facebook.com/myapp/index.php?publish=1&user=user_id";
  rt.exec("rundll32 url.dll,FileProtocolHandler " + url_post);
}

All is ok.一切正常。 When the event occurs my server open the browser at the previous link and the post appears correctly on the user (with user_id) wall.当事件发生时,我的服务器在上一个链接中打开浏览器,帖子正确显示在用户(带有 user_id)墙上。 Is possible to "visit" the link without open a browser page?是否可以在不打开浏览器页面的情况下“访问”链接? I'm using resin 4.0 for testing my app, Windows 7 Pro Service Pack 1 (but tested also in Windows XP).我正在使用树脂 4.0 来测试我的应用程序 Windows 7 Pro Service Pack 1(但也在 Windows XP 中进行了测试)。 Thanks for your attention.感谢您的关注。

if i've understood you right, you don't know how to post without opening system browser.如果我没听错的话,你不知道如何在不打开系统浏览器的情况下发帖。 Maybe you should look for programming browser like Snoopy (http://sourceforge.net/projects/snoopy/).也许你应该寻找像 Snoopy 这样的编程浏览器 (http://sourceforge.net/projects/snoopy/)。 You can make http requst without opening anything.您可以在不打开任何东西的情况下发出 http 请求。

You should take a look at the apache httpclient project.你应该看看 apache httpclient 项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM