Facebook status message?

There are so many questions regarding Facebook sharer.php, but they are all out of date. At first, Facebook discounted it, but according to the documentation of FB dev it is now back. (Edit: And now it is again ...?)

You used it like this:

http://www.facebook.com/sharer/sharer.php?u=<url to share>&t=<message text>

But the documentation now only mentions this:

https://www.facebook.com/sharer/sharer.php?u=<url to share>

enter image description here

Is it possible to set some pre-entered text in the dialog box that appears when sharing the link on Facebook?

Thank.

+3
source share
2 answers

" " URL- , (, , ,...). URL-, - Open Graph, , "" , .

" " "Share" , - -, . ( " " , .)

, API ( "" ) - , , . - , , - . , "Enter" .

API v2.0, " ", - ( ) - , . , "" ... , , .

, , Facebooks .

+12

- , - , , ( , , -, ).

, chrome facebook.com. manifest.json:

"content_scripts": [
        { 
          "matches": ["https://*.facebook.com/*",

contnet script, , markeup. ( facebook sharer) ( "share" "upload" to facebook):

sharer = (function () {
    var _ref = qs('ref') ? qs('ref') : 'unknown';
    function qs(name) {
        name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
        var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
        results = regex.exec(location.search);
        return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
    }
    function isSharer() {
        return location.pathname === '/sharer/sharer.php';
    }
    function bindEvents() {
        $('button[name="share"]').click(function() {
            analytics.send('fb_sharer', 'share', _ref);
        });
        $('#u_0_0').click(function() {
            analytics.send('fb_sharer', 'cancel', _ref);
        });
    }
    function changeText() {
        console.log($('.fcw').length);
        $('.fcw').text('Upload to Facebook');
    }
    function load() {
        if (!isSharer()) return;
        changeText();
        analytics.send('fb_sharer', 'view', _ref);
        bindEvents();
    }
    return {
        load: load
    }
})();
+2

All Articles