This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Comment.find({}) | |
| .sort({ commentDate: 1 }) | |
| .then(comments => { | |
| let commentsObject = {}; | |
| comments.forEach(comment => { | |
| let commentDate = moment(comment.commentDate).startOf("day"); | |
| if (!commentsObject[commentDate]) { | |
| commentsObject[commentDate] = 1; | |
| } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const commentSchema = new Schema({ | |
| commentDate: { | |
| type: Date, | |
| index: true | |
| }, | |
| body: { | |
| type: String | |
| }, | |
| subreddit: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fetchComments = async (startDate, limit) => { | |
| console.log(`beginning comment fetch from ${startDate} to ${endDate}`); | |
| while (startDate < endDate) { | |
| // gets the first limit comments after startDate | |
| const response = await axios.get( | |
| `https://apiv2.pushshift.io/reddit/search/comment/?q=hodl&size=${limit}&after=${startDate | |
| .toString() | |
| .substr(0, 10)}` | |
| ); | |
| const comments = response.data.data; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def calc_allocations(self, date, quantity, cap): | |
| """Figure out ideal allocations for a given date""" | |
| # { | |
| # coin_name: (percent_allocation, data) | |
| # } | |
| top_market = self.get_top_market(date, quantity) | |
| total_cap = sum([coin.market_cap for coin in top_market]) | |
| allocations = [{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 0x2ac61AcE9ab9c4cc0D06e60b1deE1bFEdbF5285D |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 0x8aC194CaC303Cfe9Ad5c22a071F655C0F8B96b81 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 0x3421AE8144B866bbE25c0c880eC4765A755EeAeC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 0x3421AE8144B866bbE25c0c880eC4765A755EeAeC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://gist.github.com/anthonytxie/325a9287763107eb45803eac0e873646 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://gist.github.com/anonymous/ba399aea35e060fac8e26be30530e3bd |
NewerOlder