How to display open graph objects in gallery view in news feed? - facebook-graph-api

I am using Facebook Open Graph with an approved action called "order". When our users make a purchase on the site, we will post what they bought in timeline and news feed. I chose the gallery view in aggregation. It shows up correctly in timeline, but not in news feed. In the newsfeed, the products are in a list view. My guess is that I'm passing the urls of the product page back to facebook, so it shows as a list of items, not just the pictures. What's the right way to make the products show up in news feed as a gallery, like pinterest or instagram?
Here's my code to post the products
purchase.products.each do |product|
graph_api.put_connections("me", "#{namespace}:order?product=#{product_url(product)}")
end
Thanks

Related

CreateView not uploading image and name of the user for a post

I'm making a web app which allows users to register to the site and let them post their posts.
For taking in their post I have used the built in CBV: CreateView. In the user post I take in the name of the user using foreignkey with null=True, image, title.
The problem is: when I go to the detail page of that post it shows that there is no file associated with the image field, so I made an if statement to check if the post contains an image. But then too, it does not show the image. It shows User:None.
I don't know what is happening, I have read that CBV take the self.request automatically and there is no need to link the current user to the post.
Following are the screenshots of my code:
models.py
browser image before clicking submit button
browser image after clicking submit button (detail page of the post)
post_detail.html
views.py
If the image is in you database than you can render it this way
<img src="{{post_detail.image.url}}">
I found the answer.
I forgot to add the enctype="multipart/form-data" in the form of my createview html.
Now it's working perfectly fine.
Screenshot of userpost_form.html
Thank you all for all the support.

how can I access FaceBook Profile_Picture album using FB graph api?

I am accessing FaceBook Developer and I am using me?fields=albums{picture} to access the cover photo of my albums . How can I go to profile picture album ? Basically I want to access the photos of profile picture album. Here is an image about what I want to do
finally I got the answer with the help of #CBroe
to get the album list type :
me?fields=albums
after that type your particular album id :
album_id/photos?fields=source
to get the photos of that particular album

Drupal 8 - Show all articles from same author

I'm new to Drupal.
I added articles using the user 1 account and using another authenticated user. When I click on the author name, it shows me the status of the user.
How do I show all articles from the same author?
you can create a drupal view
/admin/structure/views/add
display all fields you like from the article and filter with author
You can even exposed the filter

FQL - how to get all the photos a person is tagged in

I am trying to build a page on our company web site that will show all photos our company is tagged in on facebook. Its the left "Photos of You" tab when in the FB photo page.
Is there a way to select just those pictures for a photo wall on our site?
I'm using FQL to help speed up queries on large albums.
Here is some FQL to select tagged photos for a specific user/page (where 123 is uid).
SELECT object_id, pid, aid, src_big, src_small, caption, like_info,
comment_info, modified FROM photo WHERE object_id IN (SELECT
object_id FROM photo_tag WHERE subject = 123)
Not sure if it helps, but I built an application to create photo slideshows for any Facebook user or page. Feel free to also give that a try, Slideshow App

Searching for Users Facebook Albums with Graph API

I am using the Facebook Graph API to query the users Photo Albums (I am using the Facebook SDK for Android). I am sending the Request me/albums to Facebook and I receive all albums. After receiving my result I have to filter the result list because I do not want to show the albums which have the attribute can_upload=false.
Can I send any parameter with my request to Facebook which returns only albums with the attribute can_upload=true?
Regards
Michael
If you want Facebook to filter results for you, you need to use FQL.
SELECT name, object_id FROM album WHERE owner= USER_ID AND can_upload = true