Facebook使用Graph API在组墙中发布(Facebook post in group wall using Graph API)
我正在开发一个Android应用程序,需要在用户创建的组中发布。
Bundle params = new Bundle(); params.putString("link","www.google.com"); params.putString("message","Group Message"); try { String res = fb.request(GROUP_ID+"/feed",params); Log.w("Response",""+res); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } }
我也使用以下权限,
public static final String[] permissions = {"user_photos","friends_groups","read_stream","user_groups","publish_stream"};
但是当我执行此操作时,不会引发任何异常,并且不会在组的墙上发布帖子。
当我尝试使用
@[user_id:name]
创建@Mentions时,我甚至没有获得超链接。任何人都可以帮我解决上述两个问题。
谢谢。
I'm developing a android application which is requires posting in groups created by the user.
Bundle params = new Bundle(); params.putString("link","www.google.com"); params.putString("message","Group Message"); try { String res = fb.request(GROUP_ID+"/feed",params); Log.w("Response",""+res); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } }
Also i'm using the following permissions,
public static final String[] permissions = {"user_photos","friends_groups","read_stream","user_groups","publish_stream"};
But when i execute this, no exception is raised and the post is not made in the group's wall.
When i tried to create @Mentions using,
@[user_id:name]
i'm not even getting the hyperlinks.Can anyone help me in solving the above said two issues.
Thanks.
原文:
最满意答案
这是一种方式:
rowSums(simplify2array(lst))
其中
lst
是你的清单。Here is one way:
rowSums(simplify2array(lst))
where
lst
is your list.
相关问答
更多-
与sapply : y <- sapply(x, paste0, collapse = '') # [1] "ab" "c" "def" "gghh" With sapply: y <- sapply(x, paste0, collapse = '') # [1] "ab" "c" "def" "gghh"
-
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
如前所述,请查阅“R内部”手册以及“编写R扩展”的这一部分 。 As already mentioned, check out the "R internals" manual, as well as this part of "Writing R extensions".
-
尝试这个: # you can also simply write: sapply(x, function(x) x[[1]]) + y foo <- function(x) x[[1]] sapply(x, foo) + y 函数foo提取列表中的向量; sapply将这些向量作为矩阵返回; 最后,我们使用回收规则添加。 更新1 好吧,因为@Frank提到了它。 我可能会做一点解释。 R中'[['运算符(注意引用!)是一个函数,带有两个参数。 第一个是矢量类型对象,如矢量/列表; 而第二个是你想要引用 ...
-
例如 lapply(list1, setdiff, d) 给 $a [1] 2 4 5 6 9 10 $b [1] 4 5 6 9 10 11 12 13 14 15 16 17 18 19 $c [1] 9 18 24 28 阅读?setdiff了解相关功能。 For example lapply(list1, setdiff, d) gives $a [1] 2 4 5 6 9 10 $b [1] 4 5 6 9 10 11 12 13 14 15 ...
-
在R中求和矩阵列表(Sum a list of matrices in R)[2023-10-08]
矩阵只是引擎盖下的向量,因此您可以unlist ,平方和sum : sum(unlist(w)^2) #[1] 2393 使用@ akrun的示例数据给出了相同的结果。 如果你有大量的矩阵,速度会更快: w <- rep(list(matrix(1:24,nrow=6)), 1e6) system.time(sum(unlist(w)^2)) # user system elapsed # 0.11 0.00 0.10 system.time(sum(vapply(w, functio ... -
在R列表中插入元素(Inserting elements in an R list)[2023-12-22]
你的问题是你正在使用[而不是[[ 。 这应该工作: a[['first']] <- c(1,2) 应该如此: a$first <- c(1,2) 记住, [给你一个子列表 ,而[[访问特定的元素 。 Your problem is that you are using [ rather than [[. This should work: a[['first']] <- c(1,2) as should this: a$first <- c(1,2) Remember, [ gives you a ... -
R2OpenBUGS - 矩阵,列表和向量的几个问题(R2OpenBUGS - several problems with matrices, list and vectors)[2022-10-12]
问题是我试图使用只有一列作为向量的矩阵。 R没有问题但是在将数据导出到OpenBUGS时它不起作用。 该程序期望对矩阵的引用具有2个索引(对于行和列)。 我只需要替换: dose = data.matrix(rat.dat[1]) 有: dose = unlist(as.vector(rat.dat[1])) The problem was that I was trying to use a matrix with only one column as a vector. R has no probl ... -
这是一种方式: rowSums(simplify2array(lst)) 其中lst是你的清单。 Here is one way: rowSums(simplify2array(lst)) where lst is your list.
-
使用矩阵的元素,因为它是R中其他矩阵的名称(Working with elements of a matrix as it was names of other matrices in R)[2023-08-15]
欢迎来到SO。 正如你所提到的,你自己问题的关键是一个函数,它将允许使用他们的名字获取保存在内存中的对象。 函数的名字是get 。 您还需要考虑的另一个函数是ls()来检查存储在存储器中的变量是什么,并使用其名称作为字符串assign给赋值变量。 我假设如果没有定义矩阵它不存在于内存中。 我写了一段可以解决你的问题的代码,它肯定不是最优雅的解决方案,但它可以作为一个起点。 假设dt是你的初始矩阵的名字。 for i in 1:nrow(dt){ #check whether at least one m ...