-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Indira Tatikola
committed
Jun 6, 2024
1 parent
57d7f6c
commit 6a81d40
Showing
7 changed files
with
196 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
https://api.instagram.com/oauth/authorize?client_id=1182296206103770&redirect_uri=https://itatikola.com/auth/&scope=user_profile,user_media&response_type=code | ||
|
||
AQDMXjveTYyNDH8F0Ae1BxfmAuOKcRUMXjzCPLo97mCNjoKHcqL49_i93Dz_iJ4acs8RjvRZXxea5VECf7qsHiaUIPPoU4QgclGEKyOtxAkfUB9twpnwsJ11PvjoU6oFKrRTTIYltLckxLSgzU9LcWiGP5lN3ZUkS_DEPAMwQNSUjIr7F9gZih4xElhoOV2Vd192aa5zEbN9pJjcfqYQ7-e0pHHKOx-SCKjwLbp1NX8Z6g | ||
curl -X POST \ | ||
https://api.instagram.com/oauth/access_token \ | ||
-F client_id=1182296206103770\ | ||
-F client_secret=710a59a6d09fae09b621a4e889c9185c\ | ||
-F grant_type=authorization_code \ | ||
-F redirect_uri=https://itatikola.com/auth/ \ | ||
-F code=AQDMXjveTYyNDH8F0Ae1BxfmAuOKcRUMXjzCPLo97mCNjoKHcqL49_i93Dz_iJ4acs8RjvRZXxea5VECf7qsHiaUIPPoU4QgclGEKyOtxAkfUB9twpnwsJ11PvjoU6oFKrRTTIYltLckxLSgzU9LcWiGP5lN3ZUkS_DEPAMwQNSUjIr7F9gZih4xElhoOV2Vd192aa5zEbN9pJjcfqYQ7-e0pHHKOx-SCKjwLbp1NX8Z6g | ||
|
||
returned: | ||
|
||
access_token: IGQWRQSExuaTNIamJWc1o5RVdQMVRiZAmpfb2hjMTUzS1hTRmNrTk14UlQ3REUwdlpVeFF3UHlfQTk5Q0lWOV9JUWZAWc3hickFwclN3THhfLTVQQXhBUzJuMHVENjRBSUZACajQtSE42SzJLa1RocW5CMHFSOEhXNDlmeDg4ZAW5ySlp0UQZDZD | ||
curl -X GET \ | ||
'https://graph.instagram.com/me/?fields=media&access_token=IGQWRQSExuaTNIamJWc1o5RVdQMVRiZAmpfb2hjMTUzS1hTRmNrTk14UlQ3REUwdlpVeFF3UHlfQTk5Q0lWOV9JUWZAWc3hickFwclN3THhfLTVQQXhBUzJuMHVENjRBSUZACajQtSE42SzJLa1RocW5CMHFSOEhXNDlmeDg4ZAW5ySlp0UQZDZD' | ||
|
||
|
||
|
||
curl -X GET \ | ||
'https://graph.instagram.com/17911116302843368?fields=media_type,caption,permalink,media_url&access_token=IGQWRQSExuaTNIamJWc1o5RVdQMVRiZAmpfb2hjMTUzS1hTRmNrTk14UlQ3REUwdlpVeFF3UHlfQTk5Q0lWOV9JUWZAWc3hickFwclN3THhfLTVQQXhBUzJuMHVENjRBSUZACajQtSE42SzJLa1RocW5CMHFSOEhXNDlmeDg4ZAW5ySlp0UQZDZD' | ||
|
||
|
||
|
||
17854567844935592 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
/** | ||
* PRACTICE WITH OOP | ||
* function Person(name, age) { | ||
this.name = {}; | ||
const names = name.split(" "); | ||
for (let i = 0; i < names.length; i++) { | ||
let field = "name" + (i + 1); | ||
if (i === 0) { | ||
field = "first"; | ||
} else if (i === names.length - 1) { | ||
field = "last"; | ||
} | ||
this.name[field] = names[i]; | ||
} | ||
this.age = age; | ||
this.introduceSelf = () => { | ||
console.log(`Hi! I'm ${this.name.first}.`); | ||
}; | ||
this.bio = () => { | ||
console.log(`Ms./Mrs./Mr.${this.name.last} is ${this.age} years old.`); | ||
}; | ||
this.farewell = () => { | ||
console.log(`${this.name.first} has passed.`); | ||
} | ||
} | ||
const person = { | ||
name: { | ||
first: "Jane", | ||
last: "Doe" | ||
}, | ||
age: 32, | ||
bio() { | ||
console.log(`${this.name.first} ${this.name.last} is ${this.age} years old.`); | ||
}, | ||
introduceSelf() { | ||
console.log(`Hi! I'm ${this.name.first}.`); | ||
}, | ||
}; | ||
person.farewell = () => { | ||
console.log(`${person.name.first} has passed.`); | ||
}; | ||
const indira = new Person("Indira Mohini Tatikola", 19); | ||
const abirami = new Person("Abirami Chinnakaruppan", 20); | ||
*/ | ||
|
||
async function populate() { | ||
const requestURL = "https://mdn.github.io/learning-area/javascript/oojs/json/superheroes.json"; | ||
const request = new Request(requestURL); | ||
|
||
const response = await fetch(request); | ||
const superHeroes = await response.json(); | ||
|
||
populateHeader(superHeroes); | ||
populateHeroes(superHeroes); | ||
} | ||
|
||
function populateHeader(obj) { | ||
const header = document.querySelector("header"); | ||
const myH1 = document.createElement("h1"); | ||
myH1.textContent = obj.squadName; | ||
header.appendChild(myH1); | ||
|
||
const myPara = document.createElement("p"); | ||
myPara.textContent = `Hometown: ${obj.homeTown} // Formed: ${obj.formed}`; | ||
header.appendChild(myPara); | ||
} | ||
|
||
function populateHeroes(obj) { | ||
const section = document.querySelector("section"); | ||
const heroes = obj.members; | ||
|
||
for (const hero of heroes) { | ||
const myArticle = document.createElement("article"); | ||
const myH2 = document.createElement("h2"); | ||
const myPara1 = document.createElement("p"); | ||
const myPara2 = document.createElement("p"); | ||
const myPara3 = document.createElement("p"); | ||
const myList = document.createElement("ul"); | ||
|
||
myH2.textContent = hero.name; | ||
myPara1.textContent = `Secret identity: ${hero.secretIdentity}`; | ||
myPara2.textContent = `Age: ${hero.age}`; | ||
myPara3.textContent = "Superpowers:"; | ||
|
||
const superPowers = hero.powers; | ||
for (const power of superPowers) { | ||
const listItem = document.createElement("li"); | ||
listItem.textContent = power; | ||
myList.appendChild(listItem); | ||
} | ||
|
||
myArticle.appendChild(myH2); | ||
myArticle.appendChild(myPara1); | ||
myArticle.appendChild(myPara2); | ||
myArticle.appendChild(myPara3); | ||
myArticle.appendChild(myList); | ||
|
||
section.appendChild(myArticle); | ||
} | ||
} | ||
|
||
populate(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters