Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Porfolio Project 2 V1 #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,15 @@
</head>
<body>
<!-- put stuff here -->
<div class="container">
<div class="row">
<div class="col-md-6 col-md-offset-3">
<div class="wrapper">
<h1>My Instagram</h1>
<div id="list"></div>
</div>
</div>
</div>
</div>
</body>
</html>
5 changes: 4 additions & 1 deletion login.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
<meta charset="UTF-8">
<title>Instamood | Login</title>
<!-- TODO: Include Bootstrap -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<!-- TODO: Link your stylesheet -->
<script src="http://code.jquery.com/jquery-latest.js"></script>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link your stylesheet so you can customize the page
<link rel="stylesheet" href="style.css">

<!-- <script src="./script.js"></script> -->
</head>
<body>
<!-- Make sure to cd into this directory and run
'python -m SimpleHTTPServer' or 'python-m http.server' (whichever one works). -->
<!-- Replace 'YOUR_CLIENT_ID_HERE' with the client ID you get from instagram.com/developer -->
<!-- Once you do that, visit 0.0.0.0:8000 in Chrome -->
<a href="https://api.instagram.com/oauth/authorize/?client_id=YOUR_CLIENT_ID_HERE&redirect_uri=http://0.0.0.0:8000&response_type=token">Log in with Instagram</a>
<a href="https://api.instagram.com/oauth/authorize/?client_id=4e85ca944c7b4cb0a4e15c15fd5ad62b&redirect_uri=http://0.0.0.0:8000&response_type=token">Log in with Instagram</a>
</body>
</html>
18 changes: 16 additions & 2 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ $(document).ready(function() {
});

function handleResponse(response) {
console.log(response);
for (var i=0; i<response.data.length; i++) {
var url= response.data[i].images.standard_resolution.url;
var caption=response.data[i].caption.text;
// console.log(url);
$("#list").append("<img src=" + url + "/>");
$("#list").append("<div>" + caption + "</div>");
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For stage 4 adding an id to caption will make it easier to display the positivity ranking


}
// console.log(response);
// add stuff here!
}
}


// for (var i=0; i<response.response.docs.length; i++) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you already wrote the correct function, you don't need these anymore.

// $("#list").append("<div>"+response.response.docs[i].headline.main+"</div>");
// console.log(response.response.docs[i].headline.main)
// }
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your function is really concise!