Skip to content
This repository has been archived by the owner on Dec 24, 2022. It is now read-only.

Commit

Permalink
Added Spotify random test data generator GH-59
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Evans <[email protected]>
  • Loading branch information
mrbrianevans committed Apr 8, 2022
1 parent 57b0bf5 commit 0d003a2
Show file tree
Hide file tree
Showing 5 changed files with 2,605 additions and 0 deletions.
11 changes: 11 additions & 0 deletions demo-files/contacts/contacts.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Family Name,Given Name,Group Membership,Organization 1 - Name,Organization 1 - Type,Phone 1 - Type,Phone 1 - Value,Name,Photo
Brown,Robert,* myContacts,,,Mobile,07645 135629,Robert Brown,
Scott,Elizabeth,* myContacts,,,Mobile,01214 208226,Elizabeth Scott,
White,Gary,* myContacts,,,Mobile,01318 302686,Gary White,https://randomuser.me/api/portraits/men/42.jpg
Thompson,Ian,* myContacts,,,Mobile,02716 856258,Ian Thompson,
Clark,Elizabeth,* myContacts,,,Mobile,04209 919807,Elizabeth Clark,
Clark,Sarah,* myContacts,,,Mobile,07175 107027,Sarah Clark,
Hall,James,* myContacts,,,Mobile,07678 293477,James Hall,
King,Karen,* myContacts,,,Mobile,08256 159660,Karen King,
Harris,Alan,* myContacts,,,Mobile,06589 998252,Alan Harris,
Harris,Elizabeth,* myContacts,,,Mobile,04946 944457,Elizabeth Harris,
62 changes: 62 additions & 0 deletions demo-files/spotify/StreamingHistory0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
[
{
"endTime": "2021-08-01 3:09 AM",
"artistName": "U2",
"trackName": "With Or Without You",
"msPlayed": 4321
},
{
"endTime": "2021-06-03 11:19 AM",
"artistName": "Sam Cooke",
"trackName": "Bring It On Home To Me",
"msPlayed": 3957
},
{
"endTime": "2020-10-25 10:37 PM",
"artistName": "Paul Anka",
"trackName": "Diana",
"msPlayed": 4796
},
{
"endTime": "2020-04-21 2:03 PM",
"artistName": "Bing Crosby",
"trackName": "Pennies From Heaven",
"msPlayed": 250574
},
{
"endTime": "2021-03-20 1:21 PM",
"artistName": "Herb Alpert and the Tijuana Brass",
"trackName": "A Taste Of Honey",
"msPlayed": 2187
},
{
"endTime": "2020-04-14 3:10 PM",
"artistName": "Elvis Presley",
"trackName": "Heartbreak Hotel",
"msPlayed": 180293
},
{
"endTime": "2021-05-09 11:09 AM",
"artistName": "Tito Puente",
"trackName": "Oye Coma Va",
"msPlayed": 1544
},
{
"endTime": "2020-10-07 8:08 AM",
"artistName": "Black Sabbath",
"trackName": "Paranoid",
"msPlayed": 275596
},
{
"endTime": "2020-05-06 4:21 AM",
"artistName": "Curtis Mayfield",
"trackName": "Superfly",
"msPlayed": 333
},
{
"endTime": "2019-08-11 8:25 PM",
"artistName": "Whitney Houston",
"trackName": "I Will Always Love You",
"msPlayed": 2184
}
]
8 changes: 8 additions & 0 deletions lib-testing/generateDemoFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { generateInstagramLikes } from '../lib/vendors/instagram/Likes'
import { generateInstagramAccountHistory } from '../lib/vendors/instagram/AccountHistory'
import { generateInstagramInformationAboutYou } from '../lib/vendors/instagram/InformationAboutYou'
import { generateContactsFile } from '../lib/vendors/google/Contacts'
import { generateSpotifyStreamingHistory } from '../lib/vendors/spotify/StreamingHistory'

export const demoFilePath = (filename) => {
const filePath = path.resolve('..', 'demo-files', filename)
Expand Down Expand Up @@ -102,6 +103,13 @@ export const generateDemoFiles = async () => {
demoFilePath('youtube/watch-history.html'),
youtubeWatchHistory
)

//spotify
const spotifyStreamingHistory = generateSpotifyStreamingHistory({})
fs.writeFileSync(
demoFilePath('spotify/StreamingHistory0.json'),
JSON.stringify(spotifyStreamingHistory, null, 2)
)
}

generateDemoFiles()
Loading

0 comments on commit 0d003a2

Please sign in to comment.