Skip to content

Commit

Permalink
Merge pull request #76 from KenEucker/develop
Browse files Browse the repository at this point in the history
Fix issues with getTag and add deleteTag functionality
  • Loading branch information
KenEucker authored Nov 7, 2021
2 parents dc220c6 + 822f94a commit dab0c09
Show file tree
Hide file tree
Showing 34 changed files with 969 additions and 321 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ _site
dist
*.DS_Store
biketag.*
logs
logs
38 changes: 0 additions & 38 deletions examples/basic.html

This file was deleted.

42 changes: 42 additions & 0 deletions examples/browser/basic.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<html style="font-size: 16px" class="u-responsive-xl">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="utf-8" />
<title>BikeTag API test</title>
<script
type="text/javascript"
src="/dist/biketag.js"
></script>
</head>
<body>
<div id="data" widht="600"></div>
<script>
;(async () => {
const biketagAPI = new biketag({
game: 'portland',
sanity: {
projectId: 'x37ikhvs',
accessToken:
'skT5BHdVV4KxSzf2ugg1gg8P7fR1ws22Yk0Al3H2fEsSJ3KvAmR4TivtHlHeV5Ww9kIiO36TsPkEofZ39IBxZ03GKcOZqeExE2mgHXxEv9KuslRJezBQK55oYXll9kQqKwHSU3skZ3plLzRsRPosiOiyn8BJg43xcsyQuvovXKxFg4Bh907n',
dataset: 'production',
useCdn: false,
},
imgur: {
hash: 'QjnikOm',
clientId: '4fa12c6ce36984b',
clientSecret: '14dd920076de25884a1b900341022a84d78076bf',
}
})

const tags = await biketagAPI.getTag(undefined, {source: 'imgur'})
const latestTag = await biketagAPI.getTags()

console.log({tags, latestTag})

const config = biketagAPI.getConfiguration()
document.getElementById('data').innerHTML = JSON.stringify(config)
console.log('BikeTag Config', config)
})()
</script>
</body>
</html>
14 changes: 8 additions & 6 deletions examples/imgur.html → examples/browser/imgur.html
Original file line number Diff line number Diff line change
Expand Up @@ -590,13 +590,15 @@ <h1>This is placeholder content</h1>
const hash = urlParams.hash ? urlParams.hash : 'QjnikOm'

const biketagAPI = new biketag({
accessToken: urlParams.accessToken ? urlParams.accessToken : null,
game: urlParams.game ? urlParams.game : 'test',
hash,
clientId: urlParams.clientId ? urlParams.clientId : '4fa12c6ce36984b',
clientSecret: urlParams.clientSecret
? urlParams.clientSecret
: '14dd920076de25884a1b900341022a84d78076bf',
imgur: {
accessToken: urlParams.accessToken ? urlParams.accessToken : null,
hash,
clientId: urlParams.clientId ? urlParams.clientId : '4fa12c6ce36984b',
clientSecret: urlParams.clientSecret
? urlParams.clientSecret
: '14dd920076de25884a1b900341022a84d78076bf',
}
})

const albumTagsData = await biketagAPI.getTags({
Expand Down
2 changes: 1 addition & 1 deletion examples/index.html → examples/browser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<script>
;(async () => {
const biketagAPI = biketag({
const biketagAPI = new biketag({
projectId: 'x37ikhvs',
accessToken:
'skT5BHdVV4KxSzf2ugg1gg8P7fR1ws22Yk0Al3H2fEsSJ3KvAmR4TivtHlHeV5Ww9kIiO36TsPkEofZ39IBxZ03GKcOZqeExE2mgHXxEv9KuslRJezBQK55oYXll9kQqKwHSU3skZ3plLzRsRPosiOiyn8BJg43xcsyQuvovXKxFg4Bh907n',
Expand Down
18 changes: 10 additions & 8 deletions examples/sanity.html → examples/browser/sanity.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,24 @@
<div id="data"></div>
<script>
;(async () => {
const biketagAPI = biketag({
projectId: 'x37ikhvs',
accessToken:
'skT5BHdVV4KxSzf2ugg1gg8P7fR1ws22Yk0Al3H2fEsSJ3KvAmR4TivtHlHeV5Ww9kIiO36TsPkEofZ39IBxZ03GKcOZqeExE2mgHXxEv9KuslRJezBQK55oYXll9kQqKwHSU3skZ3plLzRsRPosiOiyn8BJg43xcsyQuvovXKxFg4Bh907n',
dataset: 'production',
useCdn: false,
const biketagAPI = new biketag({
game: 'test',
sanity: {
projectId: 'x37ikhvs',
accessToken:
'skrVjJPV05M2aH9UmmDnTWuq5bySsgufS3HTmzyP0e7gIhuigxuMX5MZ9I4aEMf4hkyxCTXg8bQWE34AZuXEChIcLHRfU0u6MOXbOqe6TVP26p6OVUJnlixFXHHWVaPh6OGGnzh901UZeVev7C6SCCtZqNkcs4BP1Cie9og9o9vi4J7rv7pT',
dataset: 'production',
useCdn: false,
},
})

console.log('BikeTag Config', biketagAPI.getConfiguration())

const tag5 = await biketagAPI.getTag({ tagnumber: 3, fields: ['slug'] })
const tag4 = await biketagAPI.getTag({ tagnumber: 3 })
const tag3 = await biketagAPI.getTag({ slug: 'portland-tag-3' })
const tag3 = await biketagAPI.getTag({ slug: 'test-tag-3' })
const tag2 = await biketagAPI.getTag(3)
const tag1 = await biketagAPI.getTag('portland-tag-1')
const tag1 = await biketagAPI.getTag('test-tag-1')
const tags = [tag1, tag2, tag3, tag4, tag5]
console.log({ biketagAPI, tags })

Expand Down
47 changes: 0 additions & 47 deletions examples/index.js

This file was deleted.

45 changes: 0 additions & 45 deletions examples/index.test.ts

This file was deleted.

Loading

0 comments on commit dab0c09

Please sign in to comment.