I have set up everything according from the guide here : https://developers.google.com/gdata/articles/eclipse
From there on, how do I start to retrieve the comments?
I'm sort of a beginner so it would be great if anyone could provide some codes to start off.
Firstly, you should download libraries and install required libraries shown in the page your link has.
To get comments from a youtube video you should send this URL : http://gdata.youtube.com/feeds/api/videos/VIDEO_ID/comments
YouTubeService service = new YouTubeService(
YOUR_CLIENT_ID);
String url="http://gdata.youtube.com/feeds/api/videos/VIDEO_ID/comments";
VideoEntry videoEntry = service.getEntry(new URL(url),
VideoEntry.class);
String commentUrl = videoEntry.getComments().getFeedLink().getHref();
CommentFeed commentFeed = service.getFeed(new URL(commentUrl),
CommentFeed.class);
for (CommentEntry comment : commentFeed.getEntries()) {
System.out.println(comment.getPlainTextContent());
}
You can get last 25 comments via this code. If you want to get more than 25 comments, you should read about pagination, max-results, start-index parameters.
Related
I gone through the documentation of draft-js-mention-plugin but couldn't figure a way to read all the mentions from the content. Is there a way can find all the mentions as array?. I need to store all the mentions seperately and send email.Your help is highly appreciated. I am using the example given in here
You can do like below :
const rawEditorContent = convertToRaw(this.state.editorState.getCurrentContent());
const entityMap = rawEditorContent.entityMap;
enter code here
Then loop through entityMap to get mentioned users:
Object.values(entityMap).map(entity => {
console.log(entity.data.mention);
});
I want to open a new tab with a gloda conversation from inside calendar code.
I receive an error from error console:
window not defined (or document not defined), depending on which of the two I use to Access tabmail:
let tabmail = window.document.getElementById("tabmail");
let tabmail = document.getElementById("tabmail");
The code works fine if the js file is included in an overlay xul-file.
But I want to use it outside of xul in my code.
Somewhere in my calendar code (in my 'addevent'), the same code throws the error.
This code is originally called from a rightclick on an email, but several layers deep into calendar code.
In MDN, I read that window is global? So what do I Need to do to add an tab?
This part works if tabmail is properly referenced:
tabmail.openTab("glodaList", {
collection: queryCollection,
message: aCollection.items[0],
title: tabTitle,
background: false
});
So how do I get a reference for tabmail?
Any help is appreciated.
after trying and looking through code for really some time before posting, it took only ca. 20 minutes to accidentally find the solution after submitting the question..
While browsing mailutils on mxr for something else, I found the solution in some function:
mail3PaneWindow = Services.wm.getMostRecentWindow("mail:3pane");
if (mail3PaneWindow) var tabmail = mail3PaneWindow.document.getElementById("tabmail");
I use Rfacebook package to download Facebook Fanpages posts . I also want to get the comments and likes of the posts, but I only have working code to get single comments and I fail to create a loop.
I ll post all steps one by one and keep my token updated for the next several hours.
#Step1
install.packages("Rfacebook")
install.packages("Rook")
install.packages("igraph")
#start the libaries
library(Rfacebook)
library(Rook)
library(igraph)
After installtion I can generate a token (use mine) and download the FB page humans of new york for example:
#step 2
#browse to facebook and ask for token
#browseURL("https://developers.facebook.com/tools/explorer")
token <- "CAACEdEose0cBACzNgrHPBIZAQCQ8EZBpGJqwwT8uVq74ONdKJKDk6fiXXgjBB4ZBHC93Njd2onrhGsiffK5QFqpIvZBCFEagBkOqMgjaf103XwpHhSV6YOeVdcjU813g6eJKCsdtNT7pGRYftTXgZBrSMMOyAj47mAZBGxI98iPv78qTeIqliA8UCbZBzZAVU0NoOUBTkJSPPQZDZD"
#get FB fanpage "humansofnewyork"
humansofnewyork <- getPage("humansofnewyork", token, n=500)
Now I want to create a loop that will download every comment and like for every postid. But when I run a loop append I will get a table which will replicate the colomuns horizontally at certain point instead of just adding rows vertically.
users.humansofnewyork = c()
for (i in 1:3) {
users.humansofnewyork = append(users.humansofnewyork, getPost( (humansofnewyork$id[i]) , token, n = 500, comments = TRUE,likes = TRUE, n.likes=500, n.comments=500))
}
I would be so glad if someone can help me.
Kind regards
use 'plyr' package in R, which helps in splitting the data. It has helped me till this moment.
use the following code
apply<-ldply(users.humansofnewyork,data.frame)
When I use the Graph API to fetch a comment containing an image, the returned JSON contains no reference to it, e.g.
{
"id": "10151452996201039_9302037",
"from": {
"name": "Anton Raxacoricofallapatorius Dyudin",
"id": "1534947411"
},
"message": "",
"can_remove": true,
"created_time": "2013-06-20T06:47:41+0000",
"like_count": 0,
"user_likes": false
}
I am likewise lost as to what POST field can be used to embed a picture when commenting.
How can I achieve either of the above?
Add fields=attachment to your query.
https://developers.facebook.com/docs/graph-api/reference/comment
It actually works when you use fields=attachment
https://graph.facebook.com/POSTID_COMMENTID?fields=attachment&access_token=ACCESS_TOKEN
If you want a more extensive query that return everythings and I mean everything including user id's, profile image (large version), comment related info as well and attachement info use this.
&fields=id,status_type,created_time,from{name,id,picture.width(400).height(400)},message,picture.width(400).height(400),link,icon,comments{comments{attachment,from{picture.width(400).height(400),name},id,message,created_time},from{picture.width(400).height(400),name},id,message,attachment,created_time}
Is it possible to get access to "internal" links in PDF documents using CGPDFDocument, or other means? I'm building a simple reader app and would like to deliver my content in PDF form, but if I can't support links between pages in the doc this probably isn't going to work.
This question is similar, but does not address the issue of how to support hyperlinks.
See my answer here. Basically, you'll need to get familiar with PDF link annotations.
see this sample code...pdf hyperlinks works in this
https://github.com/vfr/Reader
If you're using Quartz to open and view a PDF, then yes, it looks like you will have access to internal links. Quartz will also let you add new links to PDFs. I don't have any first hand experience with iPhone/Mac development, but it would be quite strange for them to let you add hyperlinks, but not use them.
You need to do in two steps.
First: Parse your pdf to locate marked content operators
That's an exemple of a parsing code :
-(void)parseContent() {
CGPDFOperatorTableRef myTable;
myTable = CGPDFOperatorTableCreate();
CGPDFOperatorTableSetCallback(myTable, "BMC", &myOperator_BMC);
CGPDFContentStreamRef myContentStream = CGPDFContentStreamCreateWithPage(page);
CGPDFScannerRef myScanner = CGPDFScannerCreate(myContentStream, myTable, autoZoomAreas);
CGPDFScannerScan(myScanner);
CGPDFScannerRelease(myScanner);
CGPDFContentStreamRelease(myContentStream);
}
void myOperator_BMC(CGPDFScannerRef s, void *info)
{
const char *name;
CGPDFScannerPopName(s, &name);
}
(You need to complete and adjust this code to match your requirement)
Second: respond to the toucheEnded message to handle tap on those zones and make the UI respond accordingly.