Skip to content

Commit

Permalink
adding Instagram
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Hawksworth committed Dec 10, 2018
1 parent 2ad5461 commit 2f6039e
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 3 deletions.
1 change: 1 addition & 0 deletions .env-sample
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ NETLIFY_TOKEN="YOUR_OATH_NETLIFY_API_TOKEN"
FORM_ID="THE_ID_OF_YOUR_NETLIFY_FORM"
TWITTER_KEY="KEY_TO_PULL_TWEETS"
TWITTER_SECRET="SECRET_TO_PULL_TWEETS"
INSTAGRAM_AUTH="INSTAGRAM_TOKEN"
SLACK_WEBHOOK_COMMENT_URL="SLACK_SERVICE_HOOK_FOR_COMMENTS_NOTIFICATIONS"
31 changes: 31 additions & 0 deletions src/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,37 @@ blockquote {
border-left-color: mix(#333, #fff, 10%);
}

.thumbnail-grid {

img {
width: 100%;
border: solid 4px #fff;
padding:0;
margin:0;
filter: grayscale(90%);
transition-duration: 0.5s;
}

a:link,
a:visited {
border-bottom-style:none;
display: inline-block;
width: 16%;
padding:0;
margin:0;
line-height: 1;

&:hover img,
&:focus img {
filter: grayscale(0%);
}

}



}


.solid-footer {
color: mix(#333, #fff, 40%);
Expand Down
1 change: 1 addition & 0 deletions src/site/_data/dev/instagram.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/site/_data/dev/notist.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/site/_data/dev/tweets.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"recent":[{"text":"RT @frontendyork: 6 spots left at our event next week! Please make sure to RSVP as we're going to be very limited on space! Who knew gettin…","url":"https://twitter.com/philhawksworth/status/1069217189876690944","date":"Sun Dec 02 13:10:17 +0000 2018"},{"text":"Next week I'll be visiting York to talk about @Netlify and the #JAMstack at @frontendyork's end of year bonanza!<p/><p>(Both the \"York\" and the \"Bonanza\" parts of this fill me with glee!)<p/><p>Be quick to grab your place if you are keen to join us there.<p/><p>https://t.co/sjmTs4pj8e","url":"https://twitter.com/philhawksworth/status/1068810054877495296","date":"Sat Dec 01 10:12:29 +0000 2018"},{"text":"To say that I'm proud of my sister, and inspired by all the tireless work she does to help the homeless in Mountain View, would be a huge understatement.<p/><p>So it's nice to see one of the organisations she volunteers at send her this virtual hug. ♥️<p/><p> https://t.co/j31eELjmZJ","url":"https://twitter.com/philhawksworth/status/1068537370750959617","date":"Fri Nov 30 16:08:56 +0000 2018"},{"text":"B'bye Las Vegas and #reInvent.<br/>I'm off home to sit on a sofa. (right after this) https://t.co/3bAsudDbVn","url":"https://twitter.com/philhawksworth/status/1068368395178074112","date":"Fri Nov 30 04:57:29 +0000 2018"},{"text":"Just what is the #JAMstack anyway?<p/><p>@biilmann and I sheltered from the rain to chat with @thenewstack. https://t.co/PMqse4jskX","url":"https://twitter.com/philhawksworth/status/1068365394795266048","date":"Fri Nov 30 04:45:34 +0000 2018"},{"text":"I can only assume that either:<p/><p>a. He's a fucking idiot<br/>b. He's in the pocket of the coal industry<br/>c. All of the above<p/><p>Either way, I wonder what recoverable damage this fool will do to us all. https://t.co/IwZnFHZm9B","url":"https://twitter.com/philhawksworth/status/1067687708414210048","date":"Wed Nov 28 07:52:41 +0000 2018"},{"text":"Meanwhile, on a menu in 'Merica... https://t.co/eBsRd9aTbZ https://t.co/Iub1td9dZ9","url":"https://twitter.com/philhawksworth/status/1067340954439507968","date":"Tue Nov 27 08:54:48 +0000 2018"},{"text":"Happy 1st birthday, @eleven_ty!<br/>My, how you've grown!<p/><p>Genuine kudos to @zachleat for his work on this. A side project managed with the upmost care and respect. I find much to learn from how Zach works with the community and manages the project. Hats off!<p/><p>https://t.co/T2uFCjt3DH","url":"https://twitter.com/philhawksworth/status/1067188736234934272","date":"Mon Nov 26 22:49:56 +0000 2018"},{"text":"Delighted to see this launching!<p/><p>When your infrastructure spans multiple cloud providers around the world, and you normalise things to simplify the work for developers, delivering IPv6 support is far from trivial. Interesting insights from the @netlify team in this post. https://t.co/VBzA7Si6JU","url":"https://twitter.com/philhawksworth/status/1067170550852669440","date":"Mon Nov 26 21:37:41 +0000 2018"},{"text":"Looking forward to this. Also expect some great insights from @stefanjudis on the evolution of the modern web stack. https://t.co/noGkGimzLm","url":"https://twitter.com/philhawksworth/status/1067117648683532289","date":"Mon Nov 26 18:07:28 +0000 2018"},{"text":"Just popping in to Vegas for @awscloud's #reInvent with 44,000 of my closest friends.<p/><p>👋<p/><p>If you have questions for @Netlify and you are here too, come and find us at our stand for a chat.<p/><p>If you're not here, you could always https://t.co/kUabcCuvn5 instead.","url":"https://twitter.com/philhawksworth/status/1066918384430956546","date":"Mon Nov 26 04:55:39 +0000 2018"},{"text":"Strongly agreeing with this short thread 👉 https://t.co/dwtAz6eXPB","url":"https://twitter.com/philhawksworth/status/1066690568032522246","date":"Sun Nov 25 13:50:24 +0000 2018"},{"text":"2 trips remaining for this year:<p/><p>👉 Vegas for @AWS re:invent<br/>👉 York for @gouyclub's Christmas special at @PocklingtonArts<p/><p>You know what they say, \"What happens in Pocklington, stays in Pocklington\"","url":"https://twitter.com/philhawksworth/status/1066670366993592320","date":"Sun Nov 25 12:30:07 +0000 2018"},{"text":"Looking forward to heading to back to my home town of York, to join the @frontendyork meetup. There aren't many places available, so move fast if you want to join us for talks on kanban from @srwestons, performance from @AndyCallaghan, and on @Netlify and the #JAMstack from me. https://t.co/QyYxrZICu6","url":"https://twitter.com/philhawksworth/status/1066643732001431553","date":"Sun Nov 25 10:44:17 +0000 2018"},{"text":"Got questions about @Netlify?<p/><p>Maybe you want to know how to use a feature.<br/>Or how something works behind the scenes.<p/><p>Whatever your questions, @futuregerald and I are planning to have a go at answering them. Just ask.<p/><p> 🗣 https://t.co/DXzEuqlZD8","url":"https://twitter.com/philhawksworth/status/1066029715641851904","date":"Fri Nov 23 18:04:24 +0000 2018"},{"text":"Still time to register for next week's free 1 hour webinar with myself and @stefanjudis from @contentful.<p/><p>↬ The modernisation of the web stack<br/>↬ The power of Functions-as-a-service<br/>↬ Potential of the #JAMstack<p/><p>https://t.co/gqG649jbHj","url":"https://twitter.com/philhawksworth/status/1065942933046784000","date":"Fri Nov 23 12:19:34 +0000 2018"},{"text":"🤑😲🤑😲🤑😲🤑 https://t.co/n1VK7cJNE1","url":"https://twitter.com/philhawksworth/status/1065921678176387072","date":"Fri Nov 23 10:55:06 +0000 2018"},{"text":"RT @jamstackconf: 🎥Video announcement 🎥<p/><p>Development isn't just for professionals, it's for learners, tinkerers, and activists, too. Can th…","url":"https://twitter.com/philhawksworth/status/1065380030245740547","date":"Wed Nov 21 23:02:47 +0000 2018"},{"text":"Delighted that @ItsHumdingers has sold out again this month! 🎉<br/>And that I'll get to host the night and introduce 4 superb comedians. https://t.co/0Pstk9nYzl","url":"https://twitter.com/philhawksworth/status/1065216006677823488","date":"Wed Nov 21 12:11:01 +0000 2018"}]}
{"recent":[{"text":"A crisp day in York https://t.co/kwb7SvnxGE https://t.co/AMot9MMRAq","url":"https://twitter.com/philhawksworth/status/1072142582355017729","date":"Mon Dec 10 14:54:45 +0000 2018"},{"text":"Concur 👇 https://t.co/CPxDfaFsdo","url":"https://twitter.com/philhawksworth/status/1071174608852844545","date":"Fri Dec 07 22:48:22 +0000 2018"},{"text":"RT @Netlify: This should be an interesting stream to watch. @kentcdodds is live-streaming his first #serverless experiments with @Netlify F…","url":"https://twitter.com/philhawksworth/status/1070720764591161344","date":"Thu Dec 06 16:44:57 +0000 2018"},{"text":"RT @DepressedDarth: THIS DESERVES ENDLESS RETWEETS https://t.co/g8hT03fng0","url":"https://twitter.com/philhawksworth/status/1070655379586068483","date":"Thu Dec 06 12:25:08 +0000 2018"},{"text":"Let's be very clear - The daily #christmasdeskdance by @Mandy_Kerr is like a little dose of sunshine which everyone should be tuning in to enjoy.","url":"https://twitter.com/philhawksworth/status/1070634731807629312","date":"Thu Dec 06 11:03:06 +0000 2018"},{"text":"My last talk of the year... Looking forward to this! https://t.co/Encv14FUwq","url":"https://twitter.com/philhawksworth/status/1070378432561864704","date":"Wed Dec 05 18:04:39 +0000 2018"},{"text":"RT @tobyhede: If your rebuttal to \"serverless\" is \"contains servers\" I have this thread for you of things that are not literally the words","url":"https://twitter.com/philhawksworth/status/1070329753423503360","date":"Wed Dec 05 14:51:13 +0000 2018"},{"text":"RT @Netlify: 👉 More deploy info directly in your GitHub issues.<br/>👉 Finer control over the GitHub permissions.<p/><p>We're delighted with the rece…","url":"https://twitter.com/philhawksworth/status/1069893230576189440","date":"Tue Dec 04 09:56:38 +0000 2018"},{"text":"Front row seat. https://t.co/taOZMz7Qg6 https://t.co/7vB6GUS8VA","url":"https://twitter.com/philhawksworth/status/1069741721628618753","date":"Mon Dec 03 23:54:35 +0000 2018"}]}
31 changes: 31 additions & 0 deletions src/site/_data/prod/instagram.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const axios = require('axios');
const fs = require("fs");

require('dotenv').config()
const INSTAGRAM_AUTH = process.env.INSTAGRAM_AUTH;
var url = `https://api.instagram.com/v1/users/self/media/recent/?access_token=${INSTAGRAM_AUTH}`;

module.exports = () => {
return new Promise((resolve, reject) => {
axios.get(url)
.then((response) => {

// Handy to save the results to a local file
// to prime the dev data source
if(process.env.ELEVENTY_ENV == 'prime') {
fs.writeFile(__dirname + '/../dev/instagram.json', JSON.stringify(response.data.data), function(err) {
if(err) {
console.log(err);
} else {
console.log("Instagram content primed for dev.");
}
});
}

resolve(response.data.data);
})
.catch((error) => {
reject(error);
});
})
}
Loading

0 comments on commit 2f6039e

Please sign in to comment.