Skip to content

Commit

Permalink
Merge pull request #119 from ncsa/118-add-youtube-videos-as-source-to…
Browse files Browse the repository at this point in the history
…-histogram

add youtube to histogram
  • Loading branch information
longshuicy authored May 16, 2024
2 parents 9b1399e + 2280d1b commit 34567de
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions containerized_analytics/smile/histogram/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.2] - 2024-05-16

### Changed
- Add YouTube videos as source to the histogram [#118](https://github.com/ncsa/standalone-smm-analytics/issues/118)
9 changes: 9 additions & 0 deletions containerized_analytics/smile/histogram/rabbitmq_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ def rabbitmq_handler(ch, method, properties, body):
interval = '1M'
freq = count_freq(df, 'info.dateuploaded', interval, 's')

# youtube videos
elif 'snnipet.publishedAt' in df.columns:
# default at 1 month
if 'interval' in event:
interval = event['interval']
else:
interval = '1M'
freq = count_freq(df, 'snnipet.publishedAt', interval, 's')

else:
return {'url': 'null'}

Expand Down

0 comments on commit 34567de

Please sign in to comment.