The contents are as follows:
Node server scripts for a web app that will search your social media friends by location. Client-side code not included in this repo, but you can try it out here: Friendly Radius on Pixelstomp
A redditor search engine. search by a variety of patterns, sectioned off by scope. Try it out here: http://pixelstomp.com/apps/reddit_lookup_utility/lookup.html
A youtube search engine. Search for high quality thumbnails and for details about comment activity for a specified video. Try it out here: http://pixelstomp.com/apps/yt-request/yt_lookup.html
Option 1 - Docker method:
- Have Docker installed and running.
- Run
docker build -t pixelstomp .
- Run
docker run -p 8080:8080 -d pixelstomp
.
Option 2 - Local method:
- Have Node installed.
- Run
npm install
. - Run
npm start
.
Option 3 - Run with forever
- Install
forever
withnpm install i -g forever
- Run
forever start ./forever_config.json
- To stop/restart the script, run
forever stop pixelServer
andforever restart pixelServer
Initialize via require(./youtube-module)
Note: Use of this module currently requires that a module called environment.js
exists in the same directory which provides a valid youtube app key through an exported function called getYoutubeKey
. You can change this by hard-coding your app key into the places that these functions are called, but remember not to make your app key available in a public place.
getAllComments(videoID)
: Retrieves up to 1000 comments on a given video. Returns a promise that resolves with as an array of comment threads.
- videoID {string}: The ID of the video
getVideoThumbnail(videoID, callback)
: Gets the highest quality thumbnail available for a video.
- videoID {string}: The ID of the video
- callback {function} Function that's called when thumbnail is retrieved.
getRecentVideo(user, callback)
: Gets the VideoID of the user's most recent video.
- user {string}: The user ID for a Youtube channel
- callback {function}: Function that's called when the videoID is retrieved.
getVideoChannel(videoID)
: Retrieves the channel ID for any given video. Returns a Promise that resolves with the Channel ID as a string.
- videoID {string}: The video ID of a Youtube video.
Initialize via require('./reddit-module')
Note: Use of this module requires that the methods getRedditAppKey
and getRedditAppSecret
are included in environment.js.
getPost(subreddit, id, callback)
: Retrieves a reddit post.
- subreddit {string}: the name of the subreddit
- id {string}: the post's base-36 id, found in the post's URL:
r/[subreddit]/comments/[id]/[title-of-post]
- callback {function}: is passed a single argument, an object with the following structure: {comments (array of comment items), link (object containing information about the post)}
getAllPostComments(subreddit, id)
: Retrieves all comments from a reddit post.
- subreddit {string}: the name of the subreddit
- id {string}: the post's base-36 id, found in the post's URL:
r/[subreddit]/comments/[id]/[title-of-post]
Returns a Promise that resolves with an array. Each element of the array is a comment thread, each starting with a root comment on the post itself.
getSubredditorsInfo(subreddit, callback)
: Retrieves a weighted list of intersections of redditor activity for a given subreddit.
In more detail: This method first gathers all redditors who have submitted a post currently on the front page of a subreddit (using the "Hot" filter). It then gathers the redditors' most recent comments and creates a tally of subreddits weighted by how frequently they were commented on.
- subreddit {string}: the name of the subreddit
- callback {function}: is passed a single argument, a map with the following structure: { [subreddit name]: [comment count] }
Initialize via require('./twitter-module');
Note: Use of this module currently requires that a module called environment.js
exists in the same directory which provids a valid Twitter app key through an exported function called getTwitterKey
. You can change this by hard-coding your app key into the places that getTwitterKey
is called, but just remember not to make your key available to the public.
RetrieveFriends(username, callback)
: Retrieves a list of friends for the provided user (accounts that that user follows).
- username {string}: The username of a twitter account.
- callback {function}: Is passed in a single argument, an array of objects with the following structure: {screen_name: (string), location: (string), url: (string)}
RetrieveTwitterUser(username, callback)
: Retrieves information for a single Twitter account.
- username {string}: The username of a twitter account.
- callback {function}: Is passed in a single argument, an object containing information about the requested Twitter user.