Picasa API not showing all google photos albums - java

I am using Picasa API to show user's google photos albums in my site.
I am using google's GData library. Here is my code:
PicasawebService service = new PicasawebService("MyApp");
service.setAuthSubToken("MyAccessToken");
Query query = generateQuery("https://picasaweb.google.com/data/feed/api/user/default");
query.setStringCustomParameter("kind", "album");
query.setMaxResults(1000);
UserFeed feed = service.getFeed(query, UserFeed.class);
Using this code I can see all of my albums - both old and new ones, but some users complain that they do not see all of their albums.
Any idea what can be the problem? Is it something in my code? or google photos isn't fully synced with picasa API?
Thanks.

Any idea what can be the problem? Is it something in my code? or
google photos isn't fully synced with picasa API?
It seems that this is a bug with the API. Albums created as "Shared Albums" don't appear in the API.
Steps to reproduce:
From the https://photos.google.com, click Upload and upload a picture.
In the popup shown after the image uploads, click Shared Album then New shared album and give it a name.
Confirm that the album exists at https://photos.google.com/albums and is marked as Shared.
Use the API to list your albums.
You'll find that the newly created album isn't visible via the API.
If you click Add to Album instead of Shared Album in step 2 above, the album will be visible via the API. If this unshared album is later shared, it remains visible. The problem only occurs if the album is shared when it is created.

The provided post is not working nowadays. One way to do it now is through google +.
Go to google+
Create a post and upload the photos that you want to share through picasa api and
publish the post.
Go to your home page google+ profile. In the new published post on the bottom left corner, you will see a "Show album" link, copy the link. It contains user id and album id accessible through picasa feeds.
Take into consideration that this is a hack that probably it gonna not work soon.

Related

How to get the modified content from google sheets?

I am trying to get the modified content after the given time from google sheets. Nowhere I can found the api to get the data. What i can see is getting modified date alone from the drive Api. How can I get the data using Drive or Sheets Api? Give me the suggestions if Possible
Google Drive keeps a track of revision history of files that are contained on it. There is however, no way to obtain the revisions from a request alone.
Google allows for you to receive email notifications whenever a user makes an edit to your sheet, which you can set up by completing the following steps:
In the Spreadsheet's web view, click Tools -> Notification rules...
Under Notify me at myemail#address.ext when... select Any changes are made
Under Notify me with... select Email - right away
Click Save.
You should also be aware that you will not get a notification for edits made to the sheet by you - notifications are only received when another user edits the sheet. Whenever you get an email notification, you will receive a link to view the changes to the spreadsheet in the form of a read-only web view link.
You can work around this programatically, though there isn't one right way and it can be quite complicated. You can use the Revisions: list method of the Drive REST API to get the information about the user that made an edit, as well as a list of links which you can use to export that revision of the sheet to another MIME Type, as shown below in the request response.
Requesting:
GET https://www.googleapis.com/drive/v3/files/SPREADSHEET_ID/revisions
with revisions/exportLinks,revisions/lastModifyingUser/emailAddress as the fields field and replacing SPREADSHEET_ID with the ID of the spreadsheet will give you a 200 response:
{
"revisions": [
{
"lastModifyingUser": {
"emailAddress": "username#domain.ext"
},
"exportLinks": {
"application/x-vnd.oasis.opendocument.spreadsheet": "https://docs.google.com/spreadsheets/export?id=SPREADSHEET_ID&revision=revisionNumber&exportFormat=ods",
"text/tab-separated-values": "https://docs.google.com/spreadsheets/export?id=SPREADSHEET_ID&revision=revisionNumber&exportFormat=tsv",
"application/pdf": "https://docs.google.com/spreadsheets/export?id=SPREADSHEET_ID&revision=revisionNumber&exportFormat=pdf",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "https://docs.google.com/spreadsheets/export?id=SPREADSHEET_ID&revision=revisionNumber&exportFormat=xlsx",
"text/csv": "https://docs.google.com/spreadsheets/export?id=SPREADSHEET_ID&revision=revisionNumber&exportFormat=csv",
"application/zip": "https://docs.google.com/spreadsheets/export?id=SPREADSHEET_ID&revision=revisionNumber&exportFormat=zip",
"application/vnd.oasis.opendocument.spreadsheet": "https://docs.google.com/spreadsheets/export?id=SPREADSHEET_ID&revision=1&exportFormat=ods"
}
}
]
}
With the links to individual changes, you can fetch and compare the different versions of the Sheet using Apps Script, and output A1 notation of the cells that have different values between versions. This, with the email address from the original Revisions: list request, is enough to compile a file or a log containing.
You can put this into a simple onEdit() trigger bound to the sheet will allow you to automatically get the changes each time a user edits the sheet.

How to add Cards to microsoft teams bot using Bot Framework SDK for Java?

I'm using the Java botbuilder to build a microsoft teams bot. I want to add Cards to my bot (e.g. to embed links, quick replies, and images).
In the above link it says: suggested actions are not supported in Microsoft Teams: if you want buttons to appear on a Teams bot message, use a card.
However, I can find no documentation on how to add a 'card' to the Activity schema.
I tried:
1. Using suggested actions
I tried adding my List<CardAction> to the SuggestedActions
field in Activity but they were not rendered by microsoft teams
(as expected, the documentation says this is not supported).
2. Using Attachments
I suspect it could be done using attachments, but can only find
documentation for the C#/JS versions (e.g.
https://learn.microsoft.com/en-us/azure/bot-service/nodejs/bot-builder-nodejs-send-rich-cards?view=azure-bot-service-3.0).
So I want to know how to add 'a card' to Activity schema so it can be rendered by my bot.
The BotFramework Java SDK is still in preview, so there isn't a lot of documentation I can point you towards. However, here is an example of adding a HeroCard to a reply.
Activity reply = new Activity()
.withType(ActivityTypes.MESSAGE)
.withRecipient(activity.from())
.withFrom(activity.recipient())
.withAttachments(Arrays.asList(
new Attachment()
.withContentType("application/vnd.microsoft.card.hero")
.withContent(new HeroCard()
.withTitle("Hero Card")
.withSubtitle("BotFramework")
.withButtons(Arrays.asList(new CardAction()
.withValue("https://learn.microsoft.com/en-us/azure/bot-service/")
.withTitle("Get started")
.withType(ActionTypes.OPEN_URL)
))
.withImages(Collections.singletonList(new CardImage()
.withUrl("https://sec.ch9.ms/ch9/7ff5/e07cfef0-aa3b-40bb-9baa-7c9ef8ff7ff5/buildreactionbotframework_960.jpg"))))
));
You can also take a look at the SDK Attachment Tests for more examples.
Hope this helps!

How to get attachment details (who uploaded and in which activity) in a workflow in documentum

I have created a workflow template having some manual activities. Performers of these activities are groups and any user from these groups can attach some documents to the workflow when they get respective work item in their inbox. Is there any way to differentiate who has attached what document in which activity?
IDfCollection listAttachment = wf.getAttachments() provides me all the attachments in the workflow. Is there any way to differentiate which user has attached which document in which activity?
Since you wrote DFC code I suppose you want this via code:
IDfCollection listAttachment = wf.getAttachments();
while(listAttachment.next()){
((IDfWorkflowAttachment)listAttachment).getCreatorName(); // return who has add it
((IDfWorkflowAttachment)listAttachment).getCreationDate(); // return when was added
}
Unfortunately you can find out in which activity it was added.
Check this link for IDfWorkflowAttachment javadocs.

RestFb delete featured video

Is there a way to delete a featured video without actually deleting the video?
RestFB code for deleting an object is :
Boolean deleted = fbclient.deleteObject("objectId");
But facebook graph-api request for deleting a featured video is :
You can dissociate a Video from a Page by making a DELETE request to /{page_id}/featured_videos_collection.
So my question is how to dissociate the featured video using the rest fb library. Thanks in advance
You should simply make a call like this:
Boolean deleted = fbclient.deleteObject("/<pageid>/featured_videos_collection", Parameter.with("id","<pageid>"), Parameter.with("video_id","<videoid>"));
But this is untested and only according to the graph api reference ;)

is there a way to get user created playlists using the youtube java library?

I have code like this; and it works fine. but I would like only user created lists. Is this possible?
*/
ChannelListResponse clr = youtube.channels()
.list("contentDetails").setMine(true).execute();
// Get the user's uploads playlist's id from channel list
// response
String uploadsPlaylistId = clr.getItems().get(0)
.getContentDetails().getRelatedPlaylists()
// I want user created lists not uploads or
// favorites
.getUploads();
I have just looked at youtube data api v3 (I didn't use before just looked at api.).
It seems, it provides PlaylistListResponse then you can get Playlist items and theirs ids.

Categories