How to access node from hook_html_head_alter()? I want to add an og:url tag to the &lt;head&gt; so that the correct image shows up when my page is shared on Facebook. 

I've found the hook_html_head_alter() hook which looks like I can add something to the head. I don't see how I can access the node object though when inside this method. I want to check if this page is for a certain Content Type. If it is that type, then look at some of the data on that node to determine which image to put in the og:url tag.
Drupal alter hooks, the group of hooks including hook_html_head_alter(), are not thought to add values, but to alter the values provided by another module. If you need to add a tag to the &lt;head&gt; of a node page, you should:


In a module, implement hook_node_view(), check $view_mode is not equal to 'teaser', and possibly other values for which you cannot provide the tag you want to add. Alternatively you can implement hook_entity_view(), which is called for every defined entity; if you just want to add the tag to nodes, you should rather implement hook_node_view().
You can also implement hook_preprocess_node(), which is invoked every time a node is shown, or hook_preprocess_page(), which is invoked for every page, including the page containing the node edit form. In hook_preprocess_page(), you need to verify $variables['node'] is not empty; if it empty, it means the page is not about a node.
The alternative is implementing hook_init(), but that hook is not invoked for cached pages. 
In a theme, implement hook_preprocess_node(), or hook_preprocess_page().


In all the cases, you need drupal_add_html_head() to add the tag, and menu_get_object(), when you don't have the node object, which is available in hook_node_view(), hook_preprocess_node(), and hook_preprocess_page(). You would need to call menu_get_object() in hook_init(), for example.

Notice that menu_get_object() called without arguments returns a node object, if the page is about a node, and its path is similar to node/[node ID], or starts with that string; if the page page is, for example, page/node/[node ID] (where page/node/[node ID] is not a path alias), then menu_get_object() doesn't return a node object; in the example path I used, you should use menu_get_object('node', 2).