-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquickstart.py
More file actions
46 lines (38 loc) · 1.91 KB
/
Copy pathquickstart.py
File metadata and controls
46 lines (38 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""
Quickstart: analyze one ProductHunt product and print all signals.
pip install -r requirements.txt
export APIFY_API_TOKEN=apify_api_xxxxxx
python examples/quickstart.py
"""
from producthunt_scraper import ProductHuntScraperClient
def main() -> None:
client = ProductHuntScraperClient()
url = "https://www.producthunt.com/posts/midjourney"
rec = client.analyze_one(url)
print(f"\n=== {rec['productName']} ===")
print(f" Tagline: {rec.get('tagline')}")
print(f" Website: {rec.get('website')}")
print(f" Upvotes: {rec.get('upvotes')}")
print(f" Comments: {rec.get('commentsCount')}")
print(f" Reviews: {rec.get('reviewsCount')}")
print(f" Rating: {rec.get('rating')}")
print(f" Pricing: {rec.get('pricing')} ({rec.get('pricingTier')})")
print(f" Topics: {rec.get('topicsStr')}")
print(f" Makers: {rec.get('makersStr')}")
print(f" Hunter: @{rec.get('hunter', {}).get('username')}")
print(f" Badges: {rec.get('badges')}")
print(f" Launch date: {rec.get('launchDate')}")
print(f" Daily rank: #{rec.get('dailyRank')}")
print()
print(f" Popularity score: {rec.get('popularityScore')}/100")
print(f" Maturity tier: {rec.get('maturityTier')}")
print(f" Days since launch:{rec.get('daysSinceLaunch')}")
print(f" Is new product: {rec.get('isNewProduct')}")
print(f" Upvote velocity: {rec.get('upvoteVelocity')}/day")
print(f" Engagement rate: {rec.get('engagementRate')}")
print(f" Tech stack: {rec.get('techStackSignals')}")
print(f" Sentiment: {rec.get('sentimentScore')}")
print(f" Has social proof: {rec.get('hasSocialProof')}")
print(f" Data source: {rec.get('dataSource')}")
if __name__ == "__main__":
main()