From b80922f76a80430d39a63e16eb218077062f2d91 Mon Sep 17 00:00:00 2001 From: Jan Michael Carpo Date: Sat, 9 Apr 2022 20:03:04 +0800 Subject: [PATCH 1/9] youtubeAPA.js --- index.js | 4 ++++ routes/apa/yt.js | 12 ++++++++++ utils/apa/citing/SpecialIssue.js | 4 ++-- utils/apa/citing/episodeAPA.js | 35 +++++++++++++++++++++++++++ utils/apa/citing/journalAPA.js | 32 +++++++++++++++++++++++++ utils/apa/citing/movieAPA.js | 40 +++++++++++++++---------------- utils/apa/citing/sectionAPA.js | 30 +++++++++++++++++++++++ utils/apa/citing/softwareAPA.js | 27 +++++++++++++++++++++ utils/apa/citing/speechAPA.js | 2 +- utils/apa/citing/televisionAPA.js | 2 +- utils/apa/citing/videoAPA.js | 21 ++++++++++++++++ utils/apa/citing/youtubeAPA.js | 27 +++++++++++++++++++++ utils/apa/citing/ytAPA.js | 26 ++++++++++---------- 13 files changed, 225 insertions(+), 37 deletions(-) create mode 100644 routes/apa/yt.js create mode 100644 utils/apa/citing/episodeAPA.js create mode 100644 utils/apa/citing/journalAPA.js create mode 100644 utils/apa/citing/sectionAPA.js create mode 100644 utils/apa/citing/softwareAPA.js create mode 100644 utils/apa/citing/videoAPA.js create mode 100644 utils/apa/citing/youtubeAPA.js diff --git a/index.js b/index.js index 1523c56..29473a8 100644 --- a/index.js +++ b/index.js @@ -21,6 +21,8 @@ const websites = require("./routes/apa/websites"); const youTube = require("./routes/apa/youTube"); const movies = require("./routes/apa/movies"); +const youtube = require("./routes/apa/youtube"); + // == MLA (format) == const booksMLA = require("./routes/mla/books") const journMagNews = require("./routes/mla/journMagNews"); @@ -50,6 +52,8 @@ app.use("/api/apa/websites", websites); app.use("/api/apa/youtube", youTube); app.use("/api/apa/movies", movies); + +app.use("/api/apa/you-tube", youtube); // == MLA (format) == app.use("/api/mla/books", booksMLA); app.use("/api/mla/journal-magazine-newspaper", journMagNews); diff --git a/routes/apa/yt.js b/routes/apa/yt.js new file mode 100644 index 0000000..6838425 --- /dev/null +++ b/routes/apa/yt.js @@ -0,0 +1,12 @@ +const express = require("express"); +const router = express.Router(); +const { citeYoutube } = require("../../utils/apa/citing/youtubeAPA.js"); + +router.post("/", (req, res) => { + const data = req.body; + const result = citeYoutube(data); + + res.send(result); +}); + +module.exports = router; diff --git a/utils/apa/citing/SpecialIssue.js b/utils/apa/citing/SpecialIssue.js index 853fb9c..8d6b696 100644 --- a/utils/apa/citing/SpecialIssue.js +++ b/utils/apa/citing/SpecialIssue.js @@ -2,9 +2,9 @@ const { getFormattedDate } = require("../helper/dates"); const { getFormattedAuthors } = require("../helper/authors"); const citeSpecial = ({ author, date, title, producer }) => { - const formattedAuthors = getFormattedAuthors (author); + const formattedAuthors = getFormattedAuthors; const formattedDate = getFormattedDate(date); - const referenceCitation = `${formattedAuthors} ${formattedDate} ${title} [Speacial Issue]. ${producer}`; + const referenceCitation = `${formattedAuthors} (Eds.). ${formattedDate} ${title} [Speacial Issue]. ${producer}`; return referenceCitation; }; diff --git a/utils/apa/citing/episodeAPA.js b/utils/apa/citing/episodeAPA.js new file mode 100644 index 0000000..0411ae7 --- /dev/null +++ b/utils/apa/citing/episodeAPA.js @@ -0,0 +1,35 @@ +const { getFormattedAuthors } = require("../helper/authors"); + +const citeEpisode = ({ author, year, title, producer, company }) => { + const formattedAuthors = getFormattedAuthors (author); + const formattedYear = year ? year : `n.d.` + const referenceCitation = `${formattedAuthors}. (${formattedYear}). + ${title} (Season 4, Episode 17) [TV series episode]. ${producer} (Executive producer) ${company}`; + + return referenceCitation; +}; + + +data = { + author: [ + { + firstName: "D.", + middleInitial: "", + lastName: "Egan", + role: "Producer", + }, + { + firstName: "J.", + middleInitial: "", + lastName: "Alexander", + role: "Director", + }, + ], + year: "2005", + title: "Failure to communicate", + producer: "In D. Shore", + company: "Fox Broadcasting", +}; + +console.log(citeEpisode(data)); +module.exports = { citeEpisode }; \ No newline at end of file diff --git a/utils/apa/citing/journalAPA.js b/utils/apa/citing/journalAPA.js new file mode 100644 index 0000000..a75fcd1 --- /dev/null +++ b/utils/apa/citing/journalAPA.js @@ -0,0 +1,32 @@ +const { getFormattedAuthors } = require("../helper/authors"); + +const citeJournal = ({ author, year, title, titlecase, page }) => { + const formattedAuthors = getFormattedAuthors; + const formattedYear = year ? year : `n.d.` + const referenceCitation = `${formattedAuthors}. (${formattedYear}). ${title} . ${titlecase}, 42(Suppl. 2), ${page}.`; + + return referenceCitation; +}; + + +data = { + author: [ + { + firstName: "D.", + middleInitial: "", + lastName: "Vahey", + }, + { + firstName: "L.", + middleInitial: "", + lastName: "Aiken", + }, + ], + year: "2004", + title: "Nurse burnout and patient satisfaction", + titlecase: "Medical Care", + page: "57-66", +}; + +console.log(citeJournal(data)); +module.exports = { citeJournal }; \ No newline at end of file diff --git a/utils/apa/citing/movieAPA.js b/utils/apa/citing/movieAPA.js index 8dfd1cb..40c71cc 100644 --- a/utils/apa/citing/movieAPA.js +++ b/utils/apa/citing/movieAPA.js @@ -9,25 +9,25 @@ const citeMovie = ({ author, year, title, company }) => { }; -// data = { -// author: [ -// { -// firstName: "F.", -// middleInitial: "", -// lastName: "Davidson", -// role: "Producer", -// }, -// { -// firstName: "J.", -// middleInitial: "", -// lastName: "Davidson", -// role: "Director", -// }, -// ], -// year: "2000", -// title: "B. F. Skinner: A fresh appraisal", -// company: "USA: Davidson Films", -// }; +data = { + author: [ + { + firstName: "F.", + middleInitial: "", + lastName: "Davidson", + role: "Producer", + }, + { + firstName: "J.", + middleInitial: "", + lastName: "Davidson", + role: "Director", + }, + ], + year: "2000", + title: "B. F. Skinner: A fresh appraisal", + company: "USA: Davidson Films", +}; -// console.log(citeMovie(data)); +console.log(citeMovie(data)); module.exports = { citeMovie }; \ No newline at end of file diff --git a/utils/apa/citing/sectionAPA.js b/utils/apa/citing/sectionAPA.js new file mode 100644 index 0000000..69be748 --- /dev/null +++ b/utils/apa/citing/sectionAPA.js @@ -0,0 +1,30 @@ +const { getFormattedAuthors } = require("../helper/authors"); + +const citeSection = ({ author, year, title, producer }) => { + const formattedAuthors = getFormattedAuthors; + const formattedYear = year ? year : `n.d.` + const referenceCitation = `${formattedAuthors} (Eds.). ${formattedYear} ${title} [Special section]. ${producer}, 32(2), 415–565.`; + + return referenceCitation; +}; + + +data = { + author: [ + { + firstName: "L.", + middleInitial: "", + lastName: "Jenkins", + }, + { + firstName: "R .", + middleInitial: "", + lastName: "Astley", + }, + ], + year: "2012", + title: "Beyond the LOLcats: Maru, Nyan Cat, and more", + producer: "International Journal of Memes", +}; + +console.log(citeSection(data)); \ No newline at end of file diff --git a/utils/apa/citing/softwareAPA.js b/utils/apa/citing/softwareAPA.js new file mode 100644 index 0000000..2666e56 --- /dev/null +++ b/utils/apa/citing/softwareAPA.js @@ -0,0 +1,27 @@ +const { getFormattedAuthors } = require("../helper/authors"); + +const citeSoftware = ({ author, year, title, place, producer }) => { + const formattedAuthors = getFormattedAuthors; + const formattedYear = year ? year : `n.d.` + const referenceCitation = `${formattedAuthors} ${formattedYear} ${title} [Computer software]. ${place}, ${producer}`; + + return referenceCitation; +}; + + +data = { + author: [ + { + firstName: "A.", + middleInitial: "N.", + lastName: "Esolang", + }, + ], + year: "2014", + title: "Obscure Reference Generator", + place: "Washington", + producer: "DC: E & K Press", +}; + +console.log(citeSoftware(data)); +module.exports = { citeSoftware }; \ No newline at end of file diff --git a/utils/apa/citing/speechAPA.js b/utils/apa/citing/speechAPA.js index aad1456..25a4538 100644 --- a/utils/apa/citing/speechAPA.js +++ b/utils/apa/citing/speechAPA.js @@ -2,7 +2,7 @@ const { getFormattedDate } = require("../helper/dates"); const { getFormattedAuthors } = require("../helper/authors"); const citeSpeech = ({ author, date, title, place, publisher }) => { - const formattedAuthors = getFormattedAuthors (author); + const formattedAuthors = getFormattedAuthors; const formattedDate = getFormattedDate(date); const referenceCitation = `${formattedAuthors} (Ed.). ${formattedDate} ${title}. ${place}, ${publisher}`; diff --git a/utils/apa/citing/televisionAPA.js b/utils/apa/citing/televisionAPA.js index be6857e..2fe8092 100644 --- a/utils/apa/citing/televisionAPA.js +++ b/utils/apa/citing/televisionAPA.js @@ -2,7 +2,7 @@ const { getFormattedDate } = require("../helper/dates"); const { getFormattedAuthors } = require("../helper/authors"); const citeTelevision = ({ author, date, title, publisher }) => { - const formattedAuthors = getFormattedAuthors (author); + const formattedAuthors = getFormattedAuthors; const formattedDate = getFormattedDate(date); const referenceCitation = `${formattedAuthors} ${formattedDate} ${title} [Television broadcast]. ${publisher}`; diff --git a/utils/apa/citing/videoAPA.js b/utils/apa/citing/videoAPA.js new file mode 100644 index 0000000..5234d18 --- /dev/null +++ b/utils/apa/citing/videoAPA.js @@ -0,0 +1,21 @@ +const { getFormattedAuthors } = require("../helper/authors"); + +const citeVideo = ({ studio, year, title, place, company }) => { + const formattedAuthors = getFormattedAuthors; + const formattedYear = year ? year : `n.d.` + const referenceCitation = `${studio} ${title} [Video game]. ${formattedYear} ${place}, ${company}`; + + return referenceCitation; +}; + + +data = { + studio: "Bethesda Game Studios", + year: "2011", + title: "Skyrim", + place: "Bethesda", + company: "Bethesda Softworks", +}; + +console.log(citeVideo(data)); +module.exports = { citeVideo }; \ No newline at end of file diff --git a/utils/apa/citing/youtubeAPA.js b/utils/apa/citing/youtubeAPA.js new file mode 100644 index 0000000..b1b6751 --- /dev/null +++ b/utils/apa/citing/youtubeAPA.js @@ -0,0 +1,27 @@ +const { getFormattedDate } = require("../helper/dates"); +const { getFormattedAuthors } = require("../helper/authors"); + +const citeYoutube = ({ author, date, title, url }) => { + const formattedAuthors = getFormattedAuthors (author); + const formattedDate = getFormattedDate(date); + const referenceCitation = `${formattedAuthors} ${formattedDate} ${title} [Video]. ${url}`; + + return referenceCitation; +}; + + +// data = { +// author: [ +// { +// firstName: " ", +// middleInitial: " ", +// lastName: "Bellofolletti", +// }, +// ], +// date: new Date(2009, 3, 8), +// title: "Ghost caught on surveillance camera", +// url: "http://www.youtube.com/watch?v=Dq1ms2JhYBI&feature=related", +// }; + +// console.log(citeYoutube(data)); +module.exports = { citeYoutube }; \ No newline at end of file diff --git a/utils/apa/citing/ytAPA.js b/utils/apa/citing/ytAPA.js index 730f644..00f0813 100644 --- a/utils/apa/citing/ytAPA.js +++ b/utils/apa/citing/ytAPA.js @@ -10,18 +10,18 @@ const citeYouTube = ({ author, date, title, url }) => { }; -// //data = { -// // author: [ -// // { -// // firstName: "M.", -// // middleInitial: "", -// lastName: "Apsolon", -// }, -// ], -// date: new Date(2011, 8, 9), -// title: "Real ghost girl caught on Video Tape 14", -// url: "http://www.youtube.com/watch?v=6nyGCbxD848", -// }; +data = { + author: [ + { + firstName: "M.", + middleInitial: "", + lastName: "Apsolon", + }, + ], + date: new Date(2011, 8, 9), + title: "Real ghost girl caught on Video Tape 14", + url: "http://www.youtube.com/watch?v=6nyGCbxD848", +}; -// console.log(citeYouTube(data)); +console.log(citeYouTube(data)); module.exports = { citeYouTube }; \ No newline at end of file From dc378ff0d7794906e0dc243f625e96b61518380b Mon Sep 17 00:00:00 2001 From: Jan Michael Carpo Date: Sat, 9 Apr 2022 20:52:36 +0800 Subject: [PATCH 2/9] televisionAPA.js --- index.js | 2 ++ routes/apa/television.js | 12 ++++++++++++ utils/apa/citing/televisionAPA.js | 29 +++++++++++++++-------------- utils/apa/citing/youtubeAPA.js | 26 +++++++++++++------------- 4 files changed, 42 insertions(+), 27 deletions(-) create mode 100644 routes/apa/television.js diff --git a/index.js b/index.js index 29473a8..9d7be1d 100644 --- a/index.js +++ b/index.js @@ -22,6 +22,7 @@ const youTube = require("./routes/apa/youTube"); const movies = require("./routes/apa/movies"); const youtube = require("./routes/apa/youtube"); +const television = require("./routes/apa/television"); // == MLA (format) == const booksMLA = require("./routes/mla/books") @@ -54,6 +55,7 @@ app.use("/api/apa/youtube", youTube); app.use("/api/apa/movies", movies); app.use("/api/apa/you-tube", youtube); +app.use("/api/apa/television", television); // == MLA (format) == app.use("/api/mla/books", booksMLA); app.use("/api/mla/journal-magazine-newspaper", journMagNews); diff --git a/routes/apa/television.js b/routes/apa/television.js new file mode 100644 index 0000000..3fa7114 --- /dev/null +++ b/routes/apa/television.js @@ -0,0 +1,12 @@ +const express = require("express"); +const router = express.Router(); +const { citeTelevision } = require("../../utils/apa/citing/televisionAPA.js"); + +router.post("/", (req, res) => { + const data = req.body; + const result = citeTelevision(data); + + res.send(result); +}); + +module.exports = router; diff --git a/utils/apa/citing/televisionAPA.js b/utils/apa/citing/televisionAPA.js index 2fe8092..805af87 100644 --- a/utils/apa/citing/televisionAPA.js +++ b/utils/apa/citing/televisionAPA.js @@ -2,7 +2,7 @@ const { getFormattedDate } = require("../helper/dates"); const { getFormattedAuthors } = require("../helper/authors"); const citeTelevision = ({ author, date, title, publisher }) => { - const formattedAuthors = getFormattedAuthors; + const formattedAuthors = getFormattedAuthors (author); const formattedDate = getFormattedDate(date); const referenceCitation = `${formattedAuthors} ${formattedDate} ${title} [Television broadcast]. ${publisher}`; @@ -10,17 +10,18 @@ const citeTelevision = ({ author, date, title, publisher }) => { }; -data = { - author: [ - { - firstName: "J.", - middleInitial: "G.", - lastName: "Smith", - }, - ], - date: new Date(2000, 8, 19), - title: "Every day News", - publisher: "West Broadcasting", -}; +// data = { +// author: [ +// { +// firstName: "J.", +// middleInitial: "G.", +// lastName: "Smith", +// }, +// ], +// date: new Date(1999, 8, 19), +// title: "Every day News", +// publisher: "West Broadcasting", +// }; -console.log(citeTelevision(data)); \ No newline at end of file +//console.log(citeTelevision(data)); +module.exports = { citeTelevision }; \ No newline at end of file diff --git a/utils/apa/citing/youtubeAPA.js b/utils/apa/citing/youtubeAPA.js index b1b6751..6d64ba7 100644 --- a/utils/apa/citing/youtubeAPA.js +++ b/utils/apa/citing/youtubeAPA.js @@ -10,18 +10,18 @@ const citeYoutube = ({ author, date, title, url }) => { }; -// data = { -// author: [ -// { -// firstName: " ", -// middleInitial: " ", -// lastName: "Bellofolletti", -// }, -// ], -// date: new Date(2009, 3, 8), -// title: "Ghost caught on surveillance camera", -// url: "http://www.youtube.com/watch?v=Dq1ms2JhYBI&feature=related", -// }; +data = { + author: [ + { + firstName: " ", + middleInitial: " ", + lastName: "Bellofolletti", + }, + ], + date: new Date(2009, 3, 8), + title: "Ghost caught on surveillance camera", + url: "http://www.youtube.com/watch?v=Dq1ms2JhYBI&feature=related", +}; -// console.log(citeYoutube(data)); +//console.log(citeYoutube(data)); module.exports = { citeYoutube }; \ No newline at end of file From ae9985bb37d5dda61ec5faf6b246c498f732bd27 Mon Sep 17 00:00:00 2001 From: Jan Michael Carpo Date: Sat, 9 Apr 2022 20:59:12 +0800 Subject: [PATCH 3/9] episodeAPA.js --- index.js | 3 +++ routes/apa/episode.js | 12 ++++++++++++ utils/apa/citing/episodeAPA.js | 4 ++-- utils/apa/citing/televisionAPA.js | 24 ++++++++++++------------ 4 files changed, 29 insertions(+), 14 deletions(-) create mode 100644 routes/apa/episode.js diff --git a/index.js b/index.js index 9d7be1d..98ac318 100644 --- a/index.js +++ b/index.js @@ -23,6 +23,7 @@ const movies = require("./routes/apa/movies"); const youtube = require("./routes/apa/youtube"); const television = require("./routes/apa/television"); +const episode = require("./routes/apa/episode"); // == MLA (format) == const booksMLA = require("./routes/mla/books") @@ -56,6 +57,8 @@ app.use("/api/apa/movies", movies); app.use("/api/apa/you-tube", youtube); app.use("/api/apa/television", television); +app.use("/api/apa/episode", episode); + // == MLA (format) == app.use("/api/mla/books", booksMLA); app.use("/api/mla/journal-magazine-newspaper", journMagNews); diff --git a/routes/apa/episode.js b/routes/apa/episode.js new file mode 100644 index 0000000..8d17168 --- /dev/null +++ b/routes/apa/episode.js @@ -0,0 +1,12 @@ +const express = require("express"); +const router = express.Router(); +const { citeEpisode } = require("../../utils/apa/citing/episodeAPA.js"); + +router.post("/", (req, res) => { + const data = req.body; + const result = citeEpisode(data); + + res.send(result); +}); + +module.exports = router; diff --git a/utils/apa/citing/episodeAPA.js b/utils/apa/citing/episodeAPA.js index 0411ae7..fa5fc27 100644 --- a/utils/apa/citing/episodeAPA.js +++ b/utils/apa/citing/episodeAPA.js @@ -16,7 +16,7 @@ data = { firstName: "D.", middleInitial: "", lastName: "Egan", - role: "Producer", + role: "Writer", }, { firstName: "J.", @@ -31,5 +31,5 @@ data = { company: "Fox Broadcasting", }; -console.log(citeEpisode(data)); +//console.log(citeEpisode(data)); module.exports = { citeEpisode }; \ No newline at end of file diff --git a/utils/apa/citing/televisionAPA.js b/utils/apa/citing/televisionAPA.js index 805af87..d1183c4 100644 --- a/utils/apa/citing/televisionAPA.js +++ b/utils/apa/citing/televisionAPA.js @@ -10,18 +10,18 @@ const citeTelevision = ({ author, date, title, publisher }) => { }; -// data = { -// author: [ -// { -// firstName: "J.", -// middleInitial: "G.", -// lastName: "Smith", -// }, -// ], -// date: new Date(1999, 8, 19), -// title: "Every day News", -// publisher: "West Broadcasting", -// }; +data = { + author: [ + { + firstName: "J.", + middleInitial: "G.", + lastName: "Smith", + }, + ], + date: new Date(1999, 8, 19), + title: "Every day News", + publisher: "West Broadcasting", +}; //console.log(citeTelevision(data)); module.exports = { citeTelevision }; \ No newline at end of file From 02dc775b3f1ac6f4f9e4f75f2d9f272dffb183d5 Mon Sep 17 00:00:00 2001 From: Jan Michael Carpo Date: Sat, 9 Apr 2022 21:05:22 +0800 Subject: [PATCH 4/9] journalAPA.js --- index.js | 2 ++ routes/apa/journal.js | 12 ++++++++++++ utils/apa/citing/journalAPA.js | 4 ++-- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 routes/apa/journal.js diff --git a/index.js b/index.js index 98ac318..ba6ec5d 100644 --- a/index.js +++ b/index.js @@ -24,6 +24,7 @@ const movies = require("./routes/apa/movies"); const youtube = require("./routes/apa/youtube"); const television = require("./routes/apa/television"); const episode = require("./routes/apa/episode"); +const journal = require("./routes/apa/journal"); // == MLA (format) == const booksMLA = require("./routes/mla/books") @@ -58,6 +59,7 @@ app.use("/api/apa/movies", movies); app.use("/api/apa/you-tube", youtube); app.use("/api/apa/television", television); app.use("/api/apa/episode", episode); +app.use("/api/apa/journal", journal); // == MLA (format) == app.use("/api/mla/books", booksMLA); diff --git a/routes/apa/journal.js b/routes/apa/journal.js new file mode 100644 index 0000000..65f7e1f --- /dev/null +++ b/routes/apa/journal.js @@ -0,0 +1,12 @@ +const express = require("express"); +const router = express.Router(); +const { citeJournal } = require("../../utils/apa/citing/journalAPA.js"); + +router.post("/", (req, res) => { + const data = req.body; + const result = citeJournal(data); + + res.send(result); +}); + +module.exports = router; diff --git a/utils/apa/citing/journalAPA.js b/utils/apa/citing/journalAPA.js index a75fcd1..39136d2 100644 --- a/utils/apa/citing/journalAPA.js +++ b/utils/apa/citing/journalAPA.js @@ -1,7 +1,7 @@ const { getFormattedAuthors } = require("../helper/authors"); const citeJournal = ({ author, year, title, titlecase, page }) => { - const formattedAuthors = getFormattedAuthors; + const formattedAuthors = getFormattedAuthors (author); const formattedYear = year ? year : `n.d.` const referenceCitation = `${formattedAuthors}. (${formattedYear}). ${title} . ${titlecase}, 42(Suppl. 2), ${page}.`; @@ -28,5 +28,5 @@ data = { page: "57-66", }; -console.log(citeJournal(data)); +//console.log(citeJournal(data)); module.exports = { citeJournal }; \ No newline at end of file From f09a6cc093c2740965246dc007207424f246d108 Mon Sep 17 00:00:00 2001 From: Jan Michael Carpo Date: Sat, 9 Apr 2022 21:11:48 +0800 Subject: [PATCH 5/9] speechAPA.js --- index.js | 2 ++ routes/apa/speech.js | 12 ++++++++++++ utils/apa/citing/speechAPA.js | 9 +++++---- 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 routes/apa/speech.js diff --git a/index.js b/index.js index ba6ec5d..9b5f904 100644 --- a/index.js +++ b/index.js @@ -25,6 +25,7 @@ const youtube = require("./routes/apa/youtube"); const television = require("./routes/apa/television"); const episode = require("./routes/apa/episode"); const journal = require("./routes/apa/journal"); +const speech = require("./routes/apa/speech"); // == MLA (format) == const booksMLA = require("./routes/mla/books") @@ -60,6 +61,7 @@ app.use("/api/apa/you-tube", youtube); app.use("/api/apa/television", television); app.use("/api/apa/episode", episode); app.use("/api/apa/journal", journal); +app.use("/api/apa/speech", speech); // == MLA (format) == app.use("/api/mla/books", booksMLA); diff --git a/routes/apa/speech.js b/routes/apa/speech.js new file mode 100644 index 0000000..197a7c9 --- /dev/null +++ b/routes/apa/speech.js @@ -0,0 +1,12 @@ +const express = require("express"); +const router = express.Router(); +const { citeSpeech } = require("../../utils/apa/citing/speechAPA.js"); + +router.post("/", (req, res) => { + const data = req.body; + const result = citeSpeech(data); + + res.send(result); +}); + +module.exports = router; diff --git a/utils/apa/citing/speechAPA.js b/utils/apa/citing/speechAPA.js index 25a4538..767c6f5 100644 --- a/utils/apa/citing/speechAPA.js +++ b/utils/apa/citing/speechAPA.js @@ -2,9 +2,9 @@ const { getFormattedDate } = require("../helper/dates"); const { getFormattedAuthors } = require("../helper/authors"); const citeSpeech = ({ author, date, title, place, publisher }) => { - const formattedAuthors = getFormattedAuthors; + const formattedAuthors = getFormattedAuthors (author); const formattedDate = getFormattedDate(date); - const referenceCitation = `${formattedAuthors} (Ed.). ${formattedDate} ${title}. ${place}, ${publisher}`; + const referenceCitation = `${formattedAuthors} (Ed.). ${formattedDate} ${title}. ${place}, ${publisher}.`; return referenceCitation; }; @@ -21,7 +21,8 @@ data = { date: new Date(2010), title: "Well said! Great speeches in American history", place: "Washington", - publisher: "http://www.youtube.com/watch?v=6nyGCbxD848", + publisher: "DC: E & K Publishing", }; -console.log(citeSpeech(data)); \ No newline at end of file +//console.log(citeSpeech(data)); +module.exports = { citeSpeech }; \ No newline at end of file From 40788d8dc416c44e9c9879df2306cdfc6114562b Mon Sep 17 00:00:00 2001 From: Jan Michael Carpo Date: Sat, 9 Apr 2022 21:20:58 +0800 Subject: [PATCH 6/9] SpecialIssueAPA.js --- index.js | 2 ++ routes/apa/issue.js | 12 ++++++++++++ .../citing/{SpecialIssue.js => SpecialIssueAPA.js} | 5 +++-- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 routes/apa/issue.js rename utils/apa/citing/{SpecialIssue.js => SpecialIssueAPA.js} (84%) diff --git a/index.js b/index.js index 9b5f904..90032b0 100644 --- a/index.js +++ b/index.js @@ -26,6 +26,7 @@ const television = require("./routes/apa/television"); const episode = require("./routes/apa/episode"); const journal = require("./routes/apa/journal"); const speech = require("./routes/apa/speech"); +const SpecialIssueAPA = require("./routes/apa/issue"); // == MLA (format) == const booksMLA = require("./routes/mla/books") @@ -62,6 +63,7 @@ app.use("/api/apa/television", television); app.use("/api/apa/episode", episode); app.use("/api/apa/journal", journal); app.use("/api/apa/speech", speech); +app.use("/api/apa/issue", SpecialIssueAPA); // == MLA (format) == app.use("/api/mla/books", booksMLA); diff --git a/routes/apa/issue.js b/routes/apa/issue.js new file mode 100644 index 0000000..731e14c --- /dev/null +++ b/routes/apa/issue.js @@ -0,0 +1,12 @@ +const express = require("express"); +const router = express.Router(); +const { citeSpecial } = require("../../utils/apa/citing/SpecialIssueAPA.js"); + +router.post("/", (req, res) => { + const data = req.body; + const result = citeSpecial(data); + + res.send(result); +}); + +module.exports = router; diff --git a/utils/apa/citing/SpecialIssue.js b/utils/apa/citing/SpecialIssueAPA.js similarity index 84% rename from utils/apa/citing/SpecialIssue.js rename to utils/apa/citing/SpecialIssueAPA.js index 8d6b696..5f0aacd 100644 --- a/utils/apa/citing/SpecialIssue.js +++ b/utils/apa/citing/SpecialIssueAPA.js @@ -2,7 +2,7 @@ const { getFormattedDate } = require("../helper/dates"); const { getFormattedAuthors } = require("../helper/authors"); const citeSpecial = ({ author, date, title, producer }) => { - const formattedAuthors = getFormattedAuthors; + const formattedAuthors = getFormattedAuthors (author); const formattedDate = getFormattedDate(date); const referenceCitation = `${formattedAuthors} (Eds.). ${formattedDate} ${title} [Speacial Issue]. ${producer}`; @@ -28,4 +28,5 @@ data = { producer: "International Journal of Memes", }; -console.log(citeSpecial(data)); \ No newline at end of file +//console.log(citeSpecial(data)); +module.exports = { citeSpecial }; \ No newline at end of file From aa52b149d742b671e475da7d6ccdc1482bb8b751 Mon Sep 17 00:00:00 2001 From: Jan Michael Carpo Date: Sat, 9 Apr 2022 21:25:46 +0800 Subject: [PATCH 7/9] sectionAPA.js --- index.js | 2 ++ routes/apa/section.js | 12 ++++++++++++ utils/apa/citing/sectionAPA.js | 5 +++-- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 routes/apa/section.js diff --git a/index.js b/index.js index 90032b0..a943053 100644 --- a/index.js +++ b/index.js @@ -27,6 +27,7 @@ const episode = require("./routes/apa/episode"); const journal = require("./routes/apa/journal"); const speech = require("./routes/apa/speech"); const SpecialIssueAPA = require("./routes/apa/issue"); +const section = require("./routes/apa/section"); // == MLA (format) == const booksMLA = require("./routes/mla/books") @@ -64,6 +65,7 @@ app.use("/api/apa/episode", episode); app.use("/api/apa/journal", journal); app.use("/api/apa/speech", speech); app.use("/api/apa/issue", SpecialIssueAPA); +app.use("/api/apa/section", section); // == MLA (format) == app.use("/api/mla/books", booksMLA); diff --git a/routes/apa/section.js b/routes/apa/section.js new file mode 100644 index 0000000..58e9dcf --- /dev/null +++ b/routes/apa/section.js @@ -0,0 +1,12 @@ +const express = require("express"); +const router = express.Router(); +const { citeSection } = require("../../utils/apa/citing/sectionAPA.js"); + +router.post("/", (req, res) => { + const data = req.body; + const result = citeSection(data); + + res.send(result); +}); + +module.exports = router; diff --git a/utils/apa/citing/sectionAPA.js b/utils/apa/citing/sectionAPA.js index 69be748..721d877 100644 --- a/utils/apa/citing/sectionAPA.js +++ b/utils/apa/citing/sectionAPA.js @@ -1,7 +1,7 @@ const { getFormattedAuthors } = require("../helper/authors"); const citeSection = ({ author, year, title, producer }) => { - const formattedAuthors = getFormattedAuthors; + const formattedAuthors = getFormattedAuthors (author); const formattedYear = year ? year : `n.d.` const referenceCitation = `${formattedAuthors} (Eds.). ${formattedYear} ${title} [Special section]. ${producer}, 32(2), 415–565.`; @@ -27,4 +27,5 @@ data = { producer: "International Journal of Memes", }; -console.log(citeSection(data)); \ No newline at end of file +console.log(citeSection(data)); +module.exports = { citeSection }; \ No newline at end of file From 566a9ec5b9e582ab503a3019eb9e0f320eb26546 Mon Sep 17 00:00:00 2001 From: Jan Michael Carpo Date: Sat, 9 Apr 2022 21:31:12 +0800 Subject: [PATCH 8/9] softwareAPA.js --- index.js | 2 ++ routes/apa/software.js | 12 ++++++++++++ utils/apa/citing/softwareAPA.js | 4 ++-- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 routes/apa/software.js diff --git a/index.js b/index.js index a943053..dece791 100644 --- a/index.js +++ b/index.js @@ -28,6 +28,7 @@ const journal = require("./routes/apa/journal"); const speech = require("./routes/apa/speech"); const SpecialIssueAPA = require("./routes/apa/issue"); const section = require("./routes/apa/section"); +const software = require("./routes/apa/software"); // == MLA (format) == const booksMLA = require("./routes/mla/books") @@ -66,6 +67,7 @@ app.use("/api/apa/journal", journal); app.use("/api/apa/speech", speech); app.use("/api/apa/issue", SpecialIssueAPA); app.use("/api/apa/section", section); +app.use("/api/apa/software", software); // == MLA (format) == app.use("/api/mla/books", booksMLA); diff --git a/routes/apa/software.js b/routes/apa/software.js new file mode 100644 index 0000000..28b7777 --- /dev/null +++ b/routes/apa/software.js @@ -0,0 +1,12 @@ +const express = require("express"); +const router = express.Router(); +const { citeSoftware } = require("../../utils/apa/citing/softwareAPA.js"); + +router.post("/", (req, res) => { + const data = req.body; + const result = citeSoftware(data); + + res.send(result); +}); + +module.exports = router; diff --git a/utils/apa/citing/softwareAPA.js b/utils/apa/citing/softwareAPA.js index 2666e56..b3fc16e 100644 --- a/utils/apa/citing/softwareAPA.js +++ b/utils/apa/citing/softwareAPA.js @@ -1,7 +1,7 @@ const { getFormattedAuthors } = require("../helper/authors"); const citeSoftware = ({ author, year, title, place, producer }) => { - const formattedAuthors = getFormattedAuthors; + const formattedAuthors = getFormattedAuthors (author); const formattedYear = year ? year : `n.d.` const referenceCitation = `${formattedAuthors} ${formattedYear} ${title} [Computer software]. ${place}, ${producer}`; @@ -23,5 +23,5 @@ data = { producer: "DC: E & K Press", }; -console.log(citeSoftware(data)); +//console.log(citeSoftware(data)); module.exports = { citeSoftware }; \ No newline at end of file From 9cc3c5c8bab67695d826c5b1eca64adddee0098e Mon Sep 17 00:00:00 2001 From: Jan Michael Carpo Date: Sat, 9 Apr 2022 21:36:37 +0800 Subject: [PATCH 9/9] videoAPA.js --- index.js | 4 +++- routes/apa/video.js | 12 ++++++++++++ utils/apa/citing/videoAPA.js | 4 +--- 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 routes/apa/video.js diff --git a/index.js b/index.js index dece791..7bcef5c 100644 --- a/index.js +++ b/index.js @@ -29,9 +29,10 @@ const speech = require("./routes/apa/speech"); const SpecialIssueAPA = require("./routes/apa/issue"); const section = require("./routes/apa/section"); const software = require("./routes/apa/software"); +const video = require("./routes/apa/video"); // == MLA (format) == -const booksMLA = require("./routes/mla/books") +const booksMLA = require("./routes/mla/books"); const journMagNews = require("./routes/mla/journMagNews"); // === APP === @@ -68,6 +69,7 @@ app.use("/api/apa/speech", speech); app.use("/api/apa/issue", SpecialIssueAPA); app.use("/api/apa/section", section); app.use("/api/apa/software", software); +app.use("/api/apa/video", video); // == MLA (format) == app.use("/api/mla/books", booksMLA); diff --git a/routes/apa/video.js b/routes/apa/video.js new file mode 100644 index 0000000..649a7e6 --- /dev/null +++ b/routes/apa/video.js @@ -0,0 +1,12 @@ +const express = require("express"); +const router = express.Router(); +const { citeVideo} = require("../../utils/apa/citing/videoAPA.js"); + +router.post("/", (req, res) => { + const data = req.body; + const result = citeVideo(data); + + res.send(result); +}); + +module.exports = router; diff --git a/utils/apa/citing/videoAPA.js b/utils/apa/citing/videoAPA.js index 5234d18..5f1df4f 100644 --- a/utils/apa/citing/videoAPA.js +++ b/utils/apa/citing/videoAPA.js @@ -1,7 +1,5 @@ -const { getFormattedAuthors } = require("../helper/authors"); const citeVideo = ({ studio, year, title, place, company }) => { - const formattedAuthors = getFormattedAuthors; const formattedYear = year ? year : `n.d.` const referenceCitation = `${studio} ${title} [Video game]. ${formattedYear} ${place}, ${company}`; @@ -17,5 +15,5 @@ data = { company: "Bethesda Softworks", }; -console.log(citeVideo(data)); +//console.log(citeVideo(data)); module.exports = { citeVideo }; \ No newline at end of file