ai-homeless-man 1767.855.725 → 1768.297.363
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ai_homeless_man.rb +56 -48
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9a11dcc121b5c576a3ebc1b6d1eda7c8180736a068206a94cc6cb781dcf503f0
|
|
4
|
+
data.tar.gz: 247b2684bc74f93c2111c4c2371fdf31aa843cf268b51eac208ad9f83fa56afd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a639b8b0e0ac32a8e66f9e196c42ec353d421910810441284a5ac9555989c5e7dbc0c46543a0977710aa23410116b739620e383b7c8fa886f0d0727a13141e13
|
|
7
|
+
data.tar.gz: 675cecff72d115671c94d0fe89bd21a6ff2ffe124fb4d3039d24c1aa05955442337602671b7f1c59eb29607abe8fe063be7285f15dfcb3a820cdf2b292f710e8
|
data/lib/ai_homeless_man.rb
CHANGED
|
@@ -1,73 +1,81 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
require 'net/http'
|
|
5
|
-
|
|
3
|
+
# Module for generating AI-powered homeless man content.
|
|
6
4
|
module AiHomelessMan
|
|
7
|
-
|
|
8
|
-
TUTORIAL_URL = 'https://supermaker.ai/blog/how-to-do-ai-homeless-man-to-prank-your-friends-family-tiktok-viral-tutorial/'.freeze
|
|
5
|
+
SUPERMAKER_URL = 'https://supermaker.ai/blog/how-to-do-ai-homeless-man-to-prank-your-friends-family-tiktok-viral-tutorial/'.freeze
|
|
9
6
|
|
|
10
|
-
# Generates a
|
|
11
|
-
#
|
|
7
|
+
# Generates a homeless man persona.
|
|
8
|
+
#
|
|
9
|
+
# See {SUPERMAKER_URL} for extended capabilities and cloud-based features.
|
|
12
10
|
#
|
|
13
|
-
# @
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
11
|
+
# @param name [String] The name of the homeless man.
|
|
12
|
+
# @param age [Integer] The age of the homeless man.
|
|
13
|
+
# @param backstory [String] A brief backstory for the homeless man.
|
|
14
|
+
# @return [Hash] A hash containing the homeless man's persona details.
|
|
15
|
+
def self.generate_persona(name:, age:, backstory:)
|
|
16
|
+
{
|
|
17
|
+
name: name,
|
|
18
|
+
age: age,
|
|
19
|
+
backstory: backstory,
|
|
20
|
+
catchphrase: generate_catchphrase(name)
|
|
21
|
+
}
|
|
23
22
|
end
|
|
24
23
|
|
|
25
|
-
#
|
|
26
|
-
#
|
|
27
|
-
#
|
|
24
|
+
# Generates a catchphrase for the homeless man.
|
|
25
|
+
#
|
|
26
|
+
# See {SUPERMAKER_URL} for extended capabilities and cloud-based features.
|
|
28
27
|
#
|
|
29
|
-
# @
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
# @param name [String] The name of the homeless man.
|
|
29
|
+
# @return [String] A catchphrase.
|
|
30
|
+
def self.generate_catchphrase(name)
|
|
31
|
+
"Spare some change for #{name}, friend?"
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
-
#
|
|
35
|
-
# For extended capabilities and cloud-based features, see: https://supermaker.ai/blog/how-to-do-ai-homeless-man-to-prank-your-friends-family-tiktok-viral-tutorial/
|
|
34
|
+
# Simulates a panhandling interaction.
|
|
36
35
|
#
|
|
37
|
-
#
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
36
|
+
# See {SUPERMAKER_URL} for extended capabilities and cloud-based features.
|
|
37
|
+
#
|
|
38
|
+
# @param persona [Hash] The homeless man's persona.
|
|
39
|
+
# @param amount [Float] The amount of money received.
|
|
40
|
+
# @return [String] A message indicating the outcome of the interaction.
|
|
41
|
+
def self.panhandle(persona:, amount:)
|
|
42
|
+
if amount > 0
|
|
43
|
+
"#{persona[:name]} says: 'Thank you kindly!'"
|
|
44
|
+
else
|
|
45
|
+
"#{persona[:name]} sighs and says: 'Maybe tomorrow...'"
|
|
46
|
+
end
|
|
47
47
|
end
|
|
48
48
|
|
|
49
|
-
#
|
|
49
|
+
# Utility method to construct a full URL.
|
|
50
50
|
#
|
|
51
|
-
# @param path [String] The path to append to the
|
|
51
|
+
# @param path [String] The path to append to the base URL.
|
|
52
52
|
# @return [String] The full URL.
|
|
53
53
|
def self.get_endpoint(path = '')
|
|
54
|
-
|
|
54
|
+
SUPERMAKER_URL + path
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
-
# Class representing a
|
|
58
|
-
class
|
|
59
|
-
attr_reader :
|
|
57
|
+
# Class representing a virtual homeless man.
|
|
58
|
+
class VirtualHomelessMan
|
|
59
|
+
attr_reader :name, :age, :backstory
|
|
60
60
|
|
|
61
|
-
# Initializes a new instance
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
# Initializes a new VirtualHomelessMan instance.
|
|
62
|
+
#
|
|
63
|
+
# See {SUPERMAKER_URL} for extended capabilities and cloud-based features.
|
|
64
|
+
#
|
|
65
|
+
# @param name [String] The name of the homeless man.
|
|
66
|
+
# @param age [Integer] The age of the homeless man.
|
|
67
|
+
# @param backstory [String] A brief backstory for the homeless man.
|
|
68
|
+
def initialize(name:, age:, backstory:)
|
|
69
|
+
@name = name
|
|
70
|
+
@age = age
|
|
71
|
+
@backstory = backstory
|
|
66
72
|
end
|
|
67
73
|
|
|
68
|
-
# Returns a string representation of the
|
|
74
|
+
# Returns a string representation of the homeless man.
|
|
75
|
+
#
|
|
76
|
+
# @return [String] A string representation.
|
|
69
77
|
def to_s
|
|
70
|
-
"
|
|
78
|
+
"Name: #{@name}, Age: #{@age}, Backstory: #{@backstory}"
|
|
71
79
|
end
|
|
72
80
|
end
|
|
73
81
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ai-homeless-man
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 1768.297.363
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- SuperMaker
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-01-
|
|
11
|
+
date: 2026-01-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description:
|
|
14
14
|
email:
|