Skip to content

Commit

Permalink
Fixed gh public events api return empty response. events only capture…
Browse files Browse the repository at this point in the history
… last 90 days. Changed api to use users api.
  • Loading branch information
superwizardclass committed Sep 17, 2024
1 parent f60ef3d commit 1542564
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
<script setup>
import { computed, onMounted, ref } from 'vue'
import dayjs from 'dayjs'
//import { Octokit } from 'octokit'
import Banner from './components/Banner.vue'
import Github from './components/Github.vue'
import Linkedin from './components/Linkedin.vue'
import Info from './components/Info.vue'
const githubData = ref(null)
const API_URL = 'https://api.github.com/users/superwizardclass/events'
const API_URL = 'https://api.github.com/users/superwizardclass'
const BLOG_URL = 'https://superwizardclass.github.io/blog/'
const GH_URL = 'https://github.com/superwizardclass'
const LI_URL = 'https://www.linkedin.com/in/dan3000/'
// TODO: look further into octokit integration for GitHub API authentication
/**
const octokit = new Octokit({
})
*/
const fetchGithubData = async (url) => {
const response = await fetch(url)
const data = await response.json()
githubData.value = data
}
// Not used because GH public events api not used anymore
const convertedDate = computed(() => {
const dateString = githubData.value[0]['created_at']
return dayjs(dateString).format('MMM D, YYYY')
Expand All @@ -41,10 +51,11 @@ onMounted(() => {
</div>
</Info>
<Info v-if="githubData" :url="GH_URL">
<img class="w-10 lg:w-12 rounded-full" :src="githubData[0]['actor']['avatar_url']">
<img class="w-10 lg:w-12 rounded-full" :src="githubData['avatar_url']">
<div class="">
<p class="transition-all lg:text-lg">{{ githubData[0]['actor']['display_login'] }}</p>
<p class="text-xs lg:text-sm">Last Activity: {{ convertedDate }}</p>
<p class="transition-all lg:text-lg">{{ githubData['login'] }}</p>
<p class="text-xs lg:text-base">GitHub</p>
<!--<p class="text-xs lg:text-sm">Last Activity: {{ convertedDate }}</p>-->
</div>
<img class="w-10 lg:w-12" src="./assets/github-mark-white.png">
</Info>
Expand All @@ -54,7 +65,7 @@ onMounted(() => {
<Info :url="LI_URL">
<div class="">
<p class="lg:text-lg">Dan S.</p>
<p class="text-xs lg:text-base text-neutral-300">Software Developer</p>
<p class="text-xs lg:text-base text-neutral-300">LinkedIn</p>
</div>
<img class="w-10 lg:w-14" src="./assets/LI-In-Bug.png" />
</Info>
Expand Down

0 comments on commit 1542564

Please sign in to comment.