Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add youtube to histogram #119

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading