Skip to content

Feature Request: Social Media Improvements? #824

@andyanderso

Description

@andyanderso

Hi everyone,

I would love to improve our social media integration and workflows. I think we could look into how to make our posts pull more appropriate info or even exporting content in specific formats to generate post. For now I was thinking of starting with Facebook, since I had a pretty good system going on our old site, but I would love to expand this discussion to other platforms as well (instagram, bluesky?, etc?)

Currently when we post the forecast link to Facebook it looks like this on the link preview:
Image

Previously on Facebook when we posted the link to the forecast, it would look like this:
Image

Using the danger rating and the travel advice in the link preview. I wrote two snippets to extract the relevant information from the AFP and then inserted them into our forecast page header in the og tags using a variable in our CMS theme for that page. Here are the snippets:

og:description tag: Travel Advice from AFP JSON
<?php $json_url='https://api.avalanche.org/v2/public/products/map-layer/SAC'; $json = file_get_contents($json_url,0,null,null); $json_output = json_decode($json, JSON_PRETTY_PRINT); $danger_rating = $json_output['features'][0]['properties']['danger_level']; $travel_advice = $json_output['features'][0]['properties']['travel_advice']; print $travel_advice; ?>
Ouput: Dangerous avalanche conditions. Careful snowpack evaluation, cautious route-finding and conservative decision-making essential.

og:image tag: Overall Danger Icon from AFP JSON
<?php $json_url='https://api.avalanche.org/v2/public/products/map-layer/SAC'; $json = file_get_contents($json_url,0,null,null); $json_output = json_decode($json, JSON_PRETTY_PRINT); $danger_rating =$json_output['features'][0]['properties']['danger_level']; print 'sites/all/themes/responsive_sac/img/rating-icons/200fb'.$danger_rating.'.png'; ?>
Output -> https://archive.sierraavalanchecenter.org/sites/all/themes/responsive_sac/img/rating-icons/200fb3.png

Do you think we could do something like this on the Avy-Web?

Metadata

Metadata

Assignees

No one assigned

    Labels

    NEWNew issue that needs triage/sorting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions