Skip to content

Commit

Permalink
Updated Readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeveloper72 authored Sep 8, 2018
1 parent f2c51ad commit d525fff
Showing 1 changed file with 64 additions and 3 deletions.
67 changes: 64 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,66 @@
<h1 style="text-align:center;"> Work in Progress</h1>
# Welcome to my [Personal Profile](https://ddeveloper72-profile.herokuapp.com/)

<h2 style="text-align:center;">This is my personal profile being built using Python.</h2>
This was my very first personal Python app, which was built from following different coding tutorials.

The profile will demonstrate my career interests and education as well as serve a a platform for demonstrating my work in future.
To create this app, I combined two different bootstrap templates by Start Bootstrap [Clean Blog](https://startbootstrap.com/template-overviews/clean-blog/) and [Resume](https://startbootstrap.com/template-overviews/resume/). I also learned how to use four loops in Flask to arrange my resume and work experience data which is stored as Json data.

The GitHub search API, written in JavaScript is adapted from one of [Code Institute](https://courses.codeinstitute.net/) tutorials, the Rosie Resume.

**The following are two code samples, is the GitHub API and the second is a snippet of the education Json file data source. My career data is stored in a similar way, as separate Json file.

1 GitHub API Code sample:

```javascript
function fetchGitHubInformation(event) {
$("#gh-user-data").html("");
$("#gh-repo-data").html("");

var username = $("#gh-username").val();
if (!username) {
$("#gh-user-data").html(`<h2>Please enter Github username</h2>`);
return;
}
$("#gh-user-data").html(
`<div id="loader">
<img src="static/css/loader.gif" alt="loading..." />
</div>`);

$.when(
$.getJSON(`https://api.github.com/users/${username}`),
$.getJSON(`https://api.github.com/users/${username}/repos`)
).then(
function(firstResponse, secondResponse) {
var userData = firstResponse[0];
var repoData = secondResponse[0];
$("#gh-user-data").html(userInformationHTML(userData));
$("#gh-repo-data").html(repoInformationHTML(repoData));
},
function(errorResponse) {
if (errorResponse.status === 404) {
$("#gh-user-data").html(
`<h2>No info found for user ${username}</h2>`);
} else if(errorResponse.status === 403){
var resetTime = new Date(errorResponse.getResponseHeader('x-Ratelimit-Reset')*1000);
$("#gh-user-data").html(`<h4>Too many requests, please wait until ${resetTime.toLocaleTimeString()} has passed</h4>`);
} else {
console.log(errorResponse);
$("#gh-user-data").html(
`<h2>Error: ${errorResponse.responseJSON.message}</h2>`);
}
});
}
```

2 Source data in Json format:

```javascript
[
{
"edu_title": "Full Stack Diploma",
"edu_duration": "February 2018 - Present",
"authority": "The Code Institute",
"qualification": "Studying toward a Diploma<br><small>(Credit rated by EDINBURGH NAPIER UNIVERSITY)</small>",
"image_source": "<img class=\"featureette-image img-fluid\" style=\"max-width: 40%;\" src=\"/static/img/ci.PNG\" alt=\"The Code Institute\">"
}
]
```

0 comments on commit d525fff

Please sign in to comment.