Skip to content

Commit

Permalink
Reduced API usage and source count to comply with YT reqs (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
HadesArchitect authored Mar 30, 2020
1 parent 3936e77 commit 7b13ccc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/youtube/refresh.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getYouTubeClient } from './client';
import { getCassandraClient } from '../utils/cassandra';

const MAX_VIDEOS_PER_REQUEST = 50;
const MAX_VIDEOS_PER_REFRESH = 300;
const MAX_VIDEOS_PER_REFRESH = 50;

const INSERT_VIDEO_CQL = 'INSERT INTO youtube_videos (sourceid, published_at, youtube_video_id, name, description) VALUES (?, ?, ?, ?, ?)';

Expand Down
11 changes: 2 additions & 9 deletions src/youtube/sources.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Promise from 'bluebird';

// Tags that might apply to more than one YouTube source
const globalTags = [
'asp.net', '.net', 'windows 10', 'c#', 'machine learning', 'big data', 'tutorial', 'beginner', 'mvc', 'roslyn', 'docker',
'c#', 'machine learning', 'big data', 'tutorial', 'mvc', 'docker',
'internet of things', 'time series', 'data model', 'datastax'
];

Expand Down Expand Up @@ -39,16 +39,9 @@ export const YouTubeVideoSources = {
// Tech-related sources
PLANET_CASSANDRA: createChannelSource('PLANET_CASSANDRA', 'UCvP-AXuCr-naAeEccCfKwUA', [ 'cassandra', 'database', 'nosql' ]),
DATASTAX_MEDIA: createChannelSource('DATASTAX_MEDIA', 'UCqA6zOSMpQ55vvguq4Y0jAg', [ 'datastax', 'cassandra', 'database', 'nosql' ]),
DATASTAX_ACADEMY: createChannelSource('DATASTAX_ACADEMY', 'UCAIQY251avaMv7bBv5PCo-A', [ 'datastax', 'course', 'trailer', 'roundtable', 'tutorial', 'intro', 'academy' ]),
MICROSOFT_AZURE: createChannelSource('MICROSOFT_AZURE', 'UC0m-80FnNY2Qb7obvTL_2fA', [ 'microsoft', 'azure', 'cloud', 'windows', 'linux' ]),
MICROSOFT_CLOUD_PLATFORM: createChannelSource('MICROSOFT_CLOUD_PLATFORM', 'UCSgzRJMqIiCNtoM6Q7Q9Lqw', [ 'microsoft', 'azure', 'cloud', 'windows', 'linux' ]),
HANSELMAN: createChannelSource('HANSELMAN', 'UCL-fHOdarou-CR2XUmK48Og', [ 'microsoft', 'windows', 'linux', 'azure' ]),
CASSANDRA_DATABASE: createKeywordSearchSource('CASSANDRA_DATABASE', 'cassandra database', [ 'cassandra', 'database', 'nosql' ]),

// Random sources
FUNNY_CAT_VIDEOS: createKeywordSearchSource('FUNNY_CAT_VIDEOS', 'funny cat videos', [ 'cat', 'funny' ]),
GRUMPY_CAT: createChannelSource('GRUMPY_CAT', 'UCTzVrd9ExsI3Zgnlh3_btLg', [ 'grumpy cat', 'funny' ]),
MOVIE_TRAILERS: createChannelSource('MOVIE_TRAILERS', 'UCi8e0iOVk1fEOogdfu4YgfA', [ 'movie', 'trailer', 'preview' ]),
SNL: createChannelSource('SNL', 'UCqFzWxSCi39LnW1JKFR3efg', [ 'snl', 'saturday night live', 'comedy' ]),
KEY_AND_PEELE: createPlaylistSource('KEY_AND_PEELE', 'PL83DDC2327BEB616D', [ 'key and peele', 'comedy' ])
};
};

0 comments on commit 7b13ccc

Please sign in to comment.