freunde.ma-nic.de

feature request: preview for links

@Friendiqa !Friendiqa
Hi there, and thx a lot for work on Friendiqa.
I'd like to suggest a major feature for future version:

Create preview for links:
- If a post contains a link, create a preview of that link's target,
- If a link points to a twitter-tweet, display that tweet
- If a link points to a picture, display that picture
- if a link points to a youtube-video, embedd it as a video

I know, that's a lot, but I am sure it will definitly improve user experience... at least I am missing it. 😀
That is a good idea, at least as an option. YouTube doesn't provide a file url and for most stuff I need the internal browser. I'm currently working on background sync, but after that I will work on link expansion.
How is it different from the post preview feature?
Where do I find the code for that? Probably I can adapt it for Friendiqa.
Oh, for Friendiqa! In this case, we have a specific endpoint for it:
POST /item
Content-Type: application/x-www-form-urlencoded;

Parameters:
  • type: ?
  • profile_uid: Current user id.
  • parent: Probably the parent item ID for comment preview.
  • jsreload: ?
  • preview: Should be 1.
  • post_id_random: A random number as far as I can see.
  • body: The raw BBCode body.



The response is JSON in this form:
{
    "preview" : "\n<div id=\"live-search\"><\/div>\r\n\n\n<div id=\"tread-wrapper--1\" class=\"tread-wrapper\">...<\/div>\n\n\n<div id=\"conversation-end\"><\/div>\n\n"
}

The HTML returned is a full post, so the structure will depend on the user's theme, but with frio you can find the actual post body here: <div class="wall-item-body" id="wall-item-body-P0">Post content</div>

Sorry it is such a mess.
It seems you have to be logged in to use the function. It is not possible to use it via API.☹
Not yet, but you can submit an API feature request for it.
Done. Issue number 5892.