AVOS: What How To and Not What Do

AVOS aka Pure Luck or Blind Faith

a guide to implementing functional atrocities too sublime to ignore or ramblings and preambles leading to recourse and discourse explaining the structural scaffold behind the purposive simple architecture



Webcams

Model Id List to Data

The function extractWebcamsFields($webcamsIds) will convert the list of webcams id's to an array of hashes containing the models info for display on a grid etc.

Example

$models = extractWebcamsFields([12345, 12725]);

[
    [
        [id] => 12345
        [addedOn] => 1631607911
        [updatedOn] => 1741005250
        [scrapedOn] => 1670274856
        [purged] => 0
        [nickname] => riley_sweety
        [externalId] => 0
        [name] => Riley
        [site] => Chaturbate
        [status] => Offline
        ...
    ],
    [
        [id] => 12725
        ...
    ]
]

Top


Expand Mysql Webcams Data

The function expandWebcamsFields($models) takes a list of hashes containing webcams data extracted from mysql and expands/adds the following fields:

  • imagePath
  • siteShortName
  • siteShortNameCaps
  • site
  • status
  • gender

Additionally if age is 0 it is converted to the empty string and any data stored in Redis in the key modelId/p is merged.

Top