Skip to content

Commit 947824e

Browse files
committed
Made the program easier to use and updated the readme
1 parent bc77748 commit 947824e

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
# APIpp
22

3+
Easily embed API systems into your website
4+
5+
## How to use
6+
7+
It's easy! Launch the application (keep in mind the program is not released yet, but you can still try it out) and follow the steps! (hopefully you don't get to overwhelmed, we're working on that as well).

bin/Debug/api++.exe

0 Bytes
Binary file not shown.

main.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ int main()
3838
cout << "Reading prefs file...(FUTURE FEATURE)" << endl;
3939
cout << "Start new api operation? [Y/N] ";
4040
cin >> newApiOp;
41+
system("cls");
4142
if (newApiOp == "y" || newApiOp == "Y") {
4243
cout << "Embed the code directly into a HTML file or put it in a JavaScript file? [H (HTML)/J (JavaScript)] ";
4344
cin >> fileType;
@@ -61,32 +62,42 @@ int main()
6162
}
6263
int apiSys() {
6364
int fileSys();
65+
system("cls");
6466
cout << "This application currently only supports GitHub's API system." << endl;
6567
cout << "For your own reference the base URL is https://api.github.com/" << endl;
6668
cout << "Choose whether you would like to embed a single repository or a list (found using filters). [R (single repo)/L (list of repos) [FUTURE RELEASE] ";
6769
cin >> repoSearchType;
70+
system("cls");
6871
if (repoSearchType == "R" || repoSearchType == "r") {
6972
cout << "Please type the owner of the repository you are trying to embed: ";
7073
cin >> singleRepoOwner;
74+
system("cls");
7175
cout << "Please type the name of the repository you are trying to embed: ";
7276
cin >> singleRepoName;
77+
system("cls");
7378
singleUrl = "https://api.github.com/repos/" + singleRepoOwner + "/" + singleRepoName;
7479
cout << "This is the URL api++ will be using: " << singleUrl << endl;
7580
cout << "Here is the repo HTML URL (the URL a user would go to view the repo.)" << endl;
7681
repoHtmlUrl = "https://github.com/" + singleRepoOwner + "/" + singleRepoName;
7782
cout << repoHtmlUrl << endl;
83+
system("pause");
84+
system("cls");
7885

7986
cout << "api++ needs to know what parts of the repo you will want to be displayed." << endl;
8087
cout << "Include title? [Y/N] ";
8188
cin >> repoName;
89+
system("cls");
8290
cout << "Include the full name? [Y/N] ";
8391
cin >> repoFullName;
92+
system("cls");
8493
cout << "Include the description? [Y/N] ";
8594
cin >> repoDesc;
95+
system("cls");
8696
return fileSys();
8797
}
8898
else {
8999
cout << "Sorry! The only option you have right now is to embed one repository at a time. Make sure to type R next time." << endl;
100+
system("cls");
90101
return apiSys();
91102
}
92103
}
@@ -96,13 +107,16 @@ int fileSys() {
96107
if (javascriptFile == true) {
97108
cout << "What should the JavaScript file be named? (no spaces) ";
98109
cin >> fileName;
110+
system("cls");
99111
}
100112
else if (javascriptFile == false) {
101113
cout << "What should the HTML file be named? (no spaces) ";
102114
cin >> fileName;
115+
system("cls");
103116
}
104117
cout << "Where should the file be placed? (no spaces) ";
105118
cin >> filePath;
119+
system("cls");
106120
if (javascriptFile == true) {
107121
fullFilePath = filePath + "\\\\" + fileName + ".js";
108122
}
@@ -112,6 +126,7 @@ int fileSys() {
112126
cout << "Is this good? [Y/N]" << endl;
113127
cout << fullFilePath << endl;
114128
cin >> fullFilePathConfirm;
129+
system("cls");
115130

116131
if (fullFilePathConfirm == "Y" || fullFilePathConfirm == "y") {
117132
ofstream file((fullFilePath).c_str());
@@ -136,7 +151,9 @@ int fileSys() {
136151

137152
cout << "For this code to work the code needs to place the results in a HTML element with a certain ID value. What should that value be? (no spaces) ";
138153
cin >> fileIdValue;
154+
system("cls");
139155
cout << "ID value: " << fileIdValue << endl;
156+
system("cls");
140157

141158
file << "const apiresult = document.getElementById('" << fileIdValue << "');" << endl;
142159
file << "console.log('api++ system working...')" << endl;
@@ -149,13 +166,15 @@ int fileSys() {
149166
file << "console.log('name result: ' + result.name)" << endl;
150167
cout << "Should the title element have link? [C (custom link)/R (repo link)/N (no)" << endl;
151168
cin >> fileTitleLink;
169+
system("cls");
152170
if (fileTitleLink == "R" || fileTitleLink == "r") {
153171
file << "const title = document.createElement('a')" << endl;
154172
file << "title.href = result.html_url" << endl;
155173
}
156174
else if (fileTitleLink == "C" || fileTitleLink == "c") {
157175
cout << "Custom URL: ";
158176
cin >> fileTitleLinkCustom;
177+
system("cls");
159178
file << "const title = document.createElement('a')" << endl;
160179
file << "title.href = '" << fileTitleLinkCustom << "'" << endl;
161180
}
@@ -165,7 +184,9 @@ int fileSys() {
165184
file << "title.target = '_blank'" << endl;
166185
cout << "What should the class value be for the title? (the class name allows styling with CSS) [no spaces] ";
167186
cin >> fileTitleClassName;
187+
system("cls");
168188
cout << "Class name: " << fileTitleClassName << endl;
189+
system("cls");
169190
file << "title.className = '" << fileTitleClassName << "'" << endl;
170191
file << "title.textContent = result.name" << endl;
171192
file << "apiresult.appendChild(title)" << endl;
@@ -176,7 +197,9 @@ int fileSys() {
176197
file << "const fullname = document.createElement('p')" << endl;
177198
cout << "What should the class value be for the full name? (the class name allows styling with CSS) [no spaces] ";
178199
cin >> fileFullNameClassName;
200+
system("cls");
179201
cout << "Class name: " << fileFullNameClassName << endl;
202+
system("cls");
180203
file << "fullname.className = '" << fileFullNameClassName << "'" << endl;
181204
file << "fullname.textContent = result.full_name" << endl;
182205
file << "apiresult.appendChild(fullname)" << endl;
@@ -187,7 +210,9 @@ int fileSys() {
187210
file << "const desc = document.createElement('p')" << endl;
188211
cout << "What should the class value be for the description? (the class name allows styling with CSS) [no spaces] ";
189212
cin >> fileFullNameClassName;
213+
system("cls");
190214
cout << "Class name: " << fileFullNameClassName << endl;
215+
system("cls");
191216
file << "desc.className = '" << fileFullNameClassName << "'" << endl;
192217
file << "desc.textContent = result.description" << endl;
193218
file << "apiresult.appendChild(desc)" << endl;

obj/Debug/main.o

832 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)