Pulling assets into a plugin
To get the URL of an asset in a plugin, you use a similar technique as you do in twig, so this will fetch the URL of the first image in the blogImage field:

$picture = $entry-&gt;blogImage-&gt;first()-&gt;url;


To answer you second question, onBeforeSaveEntry is run just before the entry is actually saved, not just before it is published live on the site if it has been saved with a post date in the future.

Craft doesn't fire any events just before an entry becomes 'live' on the site, so if you want the post to Buffer to go out at the same time as the entry goes live using this technique, you will need to actually create and save the entry when you want to publish it live on your site.