How to store and display map location in wagtails - django

I am trying to create an API for contact us page. The API take location through map click at wagtail admin panel and send API too. For now I want to know how can I ask user to pin a location and store it in my model. I cant think of anything to do.
class Contact_UsPage(Page): pass
My page name is Contact us thank you.
I tried looking at official wagtails documentation and couldn't find anything that would help me.

Not sure what you are doing but Googling "wagtail maps" returned some interesting looking options - including this blog post https://torchbox.com/blog/simple-maps-wagtail-google-and-geopy/ and this CodeRed block https://docs.coderedcorp.com/wagtail-crx/features/blocks/contentblocks/googlemap.html

Related

Facebook API : page feeds

I would like to integrate Facebook page's feeds to my website.
I'm trying to use the Graph API, everything works fine, but I cannot get the attached pictures (picture field).
/v2.6/{page_id}/feed
But I only get the id, created_time and message fields.
Can someone helps me with this ?
I probably miss something but I cannot found what.
Thanks by advance.
/v2.6/{page_id}/feed?fields=message,picture,...
You don´t get the additional fields if you don´t ask for them.
Existing fields: https://developers.facebook.com/docs/graph-api/reference/v2.6/post

Confluence User Mention Wiki Markup

I am creating Blog articles on Confluence via the REST API. I'd like to use User Mentions within the article, e.g. the same thing as #Ben Rogers would give you when posting directly through the UI.
I can't find anything in the documentation so I'm guessing it'll have to be a more manual process, any suggestions on how to do this?
When you insert the user mention macro in a Confluence page, you can then click on the "Open in source editor" button and you will see the code inserted looks like this:
<ac:link>
<ri:user ri:userkey="ff10413554ef222e01222669b976001a"/>
</ac:link>
So you need to know the userkey for the users you want to mention, you can look this up in the database, see following link:
https://answers.atlassian.com/questions/277551/find-user-by-resource-identifier. Then just add those links with the corresponding userkey to the html code of your page.

How to know if a comment on a page post is hidden in Graph API

We are looking for a way to find out, if a comment is hidden on a story on a page feed. We are using the Graph API to get the comments: [story_id]/comments with an Admin Access Token. Facebook tells us if we can delete the comment. However, there is no "is_hidden" flag or something.
Is there any other way to find out if the comment is hidden/marked as spam?
Thanks!
I'm PHP Developer, we have also used Facebook Graph API many times.
As per my expertise, I think we cannot fetch/identify only hidden/spam comments.
But yes you can get the comments for only particular user if you want.
For example:
1.) Get id of a fanpage with public graph data: http://graph.facebook.com/cocacola - thumsup has 507267189335315.
2.) Get ThumsUp's "like plugin" iframe display directly with some modified params: http://www.facebook.com/plugins/fan.php?connections=100&id=40796308305
3.) Now check the page sources, there are a lot of fans with links to their profiles, where you can find their profile ids or nicknames
4.) If you are interested only in profile ids use the graph api again - it will give you profile id directly
I hope you will find my answer appropriate.
If you are getting some other solution, please share
Thanks,
Shreyas
By now, finding out if a comment is hidden can be achieved via the is_hidden flag.
More detailed answer on a similar question
Facbook API docs for comment endpoint

Facebook Graph Api: Get Pages I am Admin Of

I have searched about this topic a lot, but I did'nt got any solution that suits my needs.
What I want is, when I call me/accounts , it gives me all the pages and apps I am associated with. But the thing is, I want to get only those pages of which I am an Admin not those in which I am linked as a Developer or a QA. I got a workaround to use isAdmin method once i get the page ids, but that takes a lot much time to check for each page.
Can I get something that can help me to get all pages I am admin of in one call. Its really critical.
Thanks for your help in advance guys.
You can do this pretty easily with FQL.
SELECT page_id, role, type FROM page_admin WHERE uid=me() and type != 'APPLICATION'

Facebook Open Graph API - action-type & object-type of another application (foursquare)

I am trying to retrieve a user's foursquare checkin data that is published using the open graph to Facebook. I am generally having trouble finding information (namespace, action-types and object-types) about an application that I do not own.
So far my application has successfully asked the user for (what I believe are) the appropriate permissions to access data that they have submitted to the foursquare FB application:
user_actions:playfoursquare
I found 'playfoursquare' from the url when I visit a foursquare application page in the new timeline:
http://www.facebook.com/[my_username]/app_playfoursquare
Now I am trying to query the Graph Api using a url with the following structure: (ref: http://developers.facebook.com/docs/opengraph/objects/#retrieve)
GET /me/{namespace}:{action-type}/{object-type}
Now, in the meta data of a foursquare venue page I found a og:type of 'playfoursquare:venue'.
So far I have what I suspect are the namespace and object-type. I'm just short and action-type.
From a user's foursquare application page on Facebook (http://www.facebook.com/[my_username]/app_playfoursquare) there is a lot of references to 'check-ins' so I have made an assumption about the action-type and concluded that the graph api request should be:
me/playfoursquare:{checkins,check-ins,check_ins}/venue
I tried all above variations of 'check in' and they all return:
OAuthException - Unknown path component - 2500
I can't believe that this detective work is the best way to determine the properties of another application on the Open Graph. I guess I am missing something obvious.
Either way I would appreciate any help anyone can offer here. I'm at a bit of a loss.
Thanks,
Gfte
Yes, currently, while its easy to find the namespace of another application (inspect some html, look at URLs) - its not possible to find the action names used by another app - you have to guess.
But for Foursquare, after doing some trial and error myself, I've been able to determine that their current actions are GET-able at the following URLs:
https://graph.facebook.com/me/playfoursquare:checkin_to?access_token=TOKEN
https://graph.facebook.com/me/playfoursquare:became_the_mayor_of?access_token=TOKEN
https://graph.facebook.com/me/playfoursquare:unlock?access_token=TOKEN
once you have the user_actions:playfoursquare and/or friends_actions:playfoursquare permissions.