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

[READY] - set starttime, check status of api query, and resize header.png #64

Merged
merged 5 commits into from
Mar 1, 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
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,15 @@ This is available in both Schedule and Room views
examples:
* `http://signs.scale.lan/?year=2019&month=3&day=7&hour=9&minute=10`
* `http://signs.scale.lan/?room=ballroom-de&year=2019&month=3&day=8&hour=14&minute=33`
> **NOTE:** This will not work unless `$starttime` is correctly set for the current year of the show
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for clarify this


### Yearly Tasks

There is a bit of manual effort necessary from year to year. These tasks include, but might not be limitted to:
* update the logo for the curent year at `/server/images/header.png`
* update the logo for the curent year at `/server/images/header.png` should be `360x170px`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new one is 381x170. probably close enough given transparency

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed this too. I believe it was due to: convert header.png -resize 360x170^ new.png where ^ allows for some play given the original file since I didnt want to distort it.

It looks good regardless :)

* Do a search and replace for the previous scale version (example: replace all occurances of 16x with 17x)
* verify proper XML is being supplied by drupal from the url reflected in the `$url` variable in `room.php` and `scroll.php`
* set `$starttime` in `scroll.php` which should reflect midnight of the first night of current year show
* set `$starttime` in `scroll.php` which should reflect midnight of the first night of current year show. Example: if the show starts on 3/14/24, then the entry for startime should be: `$starttime = mktime(0, 0, 0, 3, 14, 2024) / 60;`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for clarifying this

* set `$starttime` in `room.php` to match scroll.php
* set `$room_lookup_table` in `room.php` to match all rooms being used for the current year
* set `$room_lookup_table` in `index.php` to match the one in `room.php`
Expand Down
Binary file modified server/images/header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added server/images/hr-image1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 2 additions & 9 deletions server/scroll.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@
date_default_timezone_set('America/Los_Angeles');

# set yearly (change if DST starts during SCaLE)

# before "spring forward"
#$starttime = mktime(0, 0, 0, 3, 5, 2020) / 60;
#$starttime = mktime(0, 0, 0, 3, 9, 2023) / 60;

# after "spring forward"
# 18x
#$starttime = mktime(23, 0, 0, 3, 4, 2020) / 60;
# 19x starts 7/27/2022 23:00
#$starttime = mktime(23, 0, 0, 7, 27, 2022) / 60;
# 20x
$starttime = mktime(23, 0, 0, 3, 8, 2023) / 60;
# 21x
$starttime = mktime(0, 0, 0, 3, 14, 2024) / 60;
Comment on lines 6 to +10
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no more cruft


// Turn off all error reporting
error_reporting(0);
Expand Down
97 changes: 51 additions & 46 deletions server/twitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,55 +43,60 @@ function search_twitter()
$count = 0;

print '<div class="item active">';
foreach ($results['statuses'] as $status) {
$logo = $status['user']['profile_image_url'];
$name = $status['user']['name'];
$screen_name = $status['user']['screen_name'];
$comment = $status['text'];

$created = date("F d, Y h:i a", strtotime($status['created_at']));
$rightnow = round(time() / 60);

$time_diff = $rightnow - $created;

if (in_array($screen_name, $blacklist)) {
continue;
}

if (strpos($comment, 'RT') !== FALSE && in_array($screen_name, $promote) !== TRUE) {
continue;
}

if ($count % 3 == 0 && $count > 0) {

# ensure twitter response actually contains statuses
# TODO: fix broken query due to upstream changes
if (array_key_exists('statuses', $results)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for wrapping this.

foreach ($results['statuses'] as $status) {
$logo = $status['user']['profile_image_url'];
$name = $status['user']['name'];
$screen_name = $status['user']['screen_name'];
$comment = $status['text'];

$created = date("F d, Y h:i a", strtotime($status['created_at']));
$rightnow = round(time() / 60);

$time_diff = $rightnow - $created;

if (in_array($screen_name, $blacklist)) {
continue;
}

if (strpos($comment, 'RT') !== FALSE && in_array($screen_name, $promote) !== TRUE) {
continue;
}

if ($count % 3 == 0 && $count > 0) {
print '</div>';
print '<div class="item">';
}

if (in_array($screen_name, $promote)) {
print '<div class="tweet tweetpromote media">';
} else {
print '<div class="tweet media">';
}

print '<div class="vcard">';
print '<a class="pull-left" href="#">';
//print "<div class='tweet-pic'>";
// print "<img class='media-object' style=\"height: 48px; width: 48px;\" src=\"$logo\">";
//print "</div>";
print '</a>';
print '</div>';
print '<div class="item">';
}

if (in_array($screen_name, $promote)) {
print '<div class="tweet tweetpromote media">';
} else {
print '<div class="tweet media">';
print '<div class="hentry">';
print '<div class="media-body'>
print "<span class='media-heading'>$screen_name </span>";
print "<span class=\"tweet-comment\">$comment</span>";
print "<span class=\"tweet-time\">$created</span>";
print "</div>";
print "</div>";

$count += 1;

}

print '<div class="vcard">';
print '<a class="pull-left" href="#">';
//print "<div class='tweet-pic'>";
// print "<img class='media-object' style=\"height: 48px; width: 48px;\" src=\"$logo\">";
//print "</div>";
print '</a>';
print '</div>';

print '<div class="hentry">';
print '<div class="media-body'>
print "<span class='media-heading'>$screen_name </span>";
print "<span class=\"tweet-comment\">$comment</span>";
print "<span class=\"tweet-time\">$created</span>";
print "</div>";
print "</div>";

$count += 1;

}
}
print '</div>';
}

Expand Down
Loading