Repository navigation
Expand file tree
/
Copy pathfoolproof_guide.py
More file actions
326 lines (278 loc) · 12.7 KB
/
Copy pathfoolproof_guide.py
File metadata and controls
326 lines (278 loc) · 12.7 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
#!/usr/bin/env python3
"""
IG Prune - Foolproof Life Improvement Guide
Circular logic system that guides users through digital decluttering
"""
import sys
import time
from pathlib import Path
class FoolproofGuide:
def __init__(self):
self.data_dir = Path("data")
self.steps_completed = []
self.current_step = 0
def print_header(self):
"""Print the life improvement header."""
print("🏠" + "="*60 + "🏠")
print(" DIGITAL DECLUTTERING: Your Instagram Life Cleanup")
print("🏠" + "="*60 + "🏠")
print()
print("✨ Welcome to the final phase of your life decluttering journey!")
print(" You've organized your home, your schedule, your mind...")
print(" Now it's time to declutter your digital life.")
print()
print("🎯 GOAL: Clean up your Instagram following list")
print(" Remove accounts that don't add value to your life")
print(" Keep only what inspires and serves you")
print()
def check_prerequisites(self):
"""Check if user has everything they need."""
print("🔍 STEP 1: Checking your setup...")
time.sleep(1)
issues = []
# Check Python
if sys.version_info < (3, 8):
issues.append("❌ Python 3.8+ required (you have {})".format(sys.version))
else:
print("✅ Python version: {}".format(sys.version.split()[0]))
# Check virtual environment
if hasattr(sys, 'real_prefix') or (hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix):
print("✅ Virtual environment: Active")
else:
issues.append("❌ Virtual environment not active")
# Check dependencies
try:
import pandas
import instagram_private_api
print("✅ Dependencies: Installed")
except ImportError as e:
issues.append("❌ Missing dependencies: {}".format(e))
if issues:
print("\n🚨 SETUP ISSUES FOUND:")
for issue in issues:
print(" {}".format(issue))
print("\n💡 SOLUTION:")
print(" Run: python3 setup.py")
return False
print("✅ Setup complete!")
return True
def guide_data_export(self):
"""Guide user through data export process."""
print("\n📤 STEP 2: Getting your Instagram data...")
time.sleep(1)
# Check if data files exist
followers_file = Path("followers_1.json")
following_file = Path("following.json")
if followers_file.exists() and following_file.exists():
print("✅ Instagram data files found!")
return True
print("📱 You need to export your Instagram data first.")
print()
print("🔧 METHOD 1 (Recommended - 100% reliable):")
print(" 1. Open Instagram on your phone/computer")
print(" 2. Go to Settings → Privacy → Data Download")
print(" 3. Request your data (takes 24-48 hours)")
print(" 4. Download the ZIP file when ready")
print(" 5. Extract followers_1.json and following.json")
print(" 6. Place them in this project folder")
print()
print("🔧 METHOD 2 (Try if you want):")
print(" Run: python3 -m src.export_lists YOUR_USERNAME")
print(" (May hit rate limits - if so, use Method 1)")
print()
while True:
choice = input("🤔 Do you have your Instagram data files ready? (y/n/help): ").lower()
if choice == 'y':
if followers_file.exists() and following_file.exists():
print("✅ Great! Data files found.")
return True
else:
print("❌ Files not found. Please place followers_1.json and following.json in this folder.")
continue
elif choice == 'n':
print("📋 Please follow the steps above to get your data, then come back.")
print(" This tool will wait for you...")
input(" Press Enter when you're ready to continue...")
continue
elif choice == 'help':
self.show_help()
continue
else:
print("Please answer 'y' for yes, 'n' for no, or 'help' for assistance.")
def show_help(self):
"""Show detailed help for data export."""
print("\n📖 DETAILED HELP:")
print("="*50)
print("Instagram Data Export Process:")
print()
print("1. 📱 On your phone/computer, open Instagram")
print("2. ⚙️ Go to Settings (gear icon)")
print("3. 🔒 Tap 'Privacy'")
print("4. 📥 Tap 'Data Download'")
print("5. 📋 Tap 'Request Download'")
print("6. ⏰ Wait 24-48 hours for Instagram to prepare your data")
print("7. 📧 Check your email for the download link")
print("8. 💾 Download the ZIP file")
print("9. 📂 Extract the ZIP file")
print("10. 📄 Find 'followers_1.json' and 'following.json'")
print("11. 📁 Copy them to this project folder")
print()
print("💡 Why this method?")
print(" - 100% reliable (no rate limits)")
print(" - Gets complete data")
print(" - Uses Instagram's official system")
print(" - No login credentials needed for export")
print()
def guide_classification(self):
"""Guide user through classification process."""
print("\n🏷️ STEP 3: Classifying your accounts...")
time.sleep(1)
print("🧠 The system will automatically classify your accounts:")
print(" T1 (Keep): Professional/interest accounts (photography, tech, space)")
print(" T2 (Influencer): General influencers and brands")
print(" T3 (Default): Regular accounts that don't follow you back")
print(" T4 (Adult Content): Adult/NSFW content (highest priority removal)")
print()
try:
import subprocess
result = subprocess.run([sys.executable, "-m", "src.classify_nonfollowers"],
capture_output=True, text=True)
if result.returncode == 0:
print("✅ Classification complete!")
print(result.stdout)
return True
else:
print("❌ Classification failed:")
print(result.stderr)
return False
except Exception as e:
print("❌ Error during classification: {}".format(e))
return False
def guide_batch_generation(self):
"""Guide user through batch generation."""
print("\n📋 STEP 4: Generating your daily cleanup batch...")
time.sleep(1)
print("🎯 Creating a focused list of accounts to unfollow today.")
print(" The system prioritizes inappropriate content first.")
print()
try:
import subprocess
result = subprocess.run([sys.executable, "-m", "src.daily_pick"],
capture_output=True, text=True)
if result.returncode == 0:
print("✅ Daily batch generated!")
print(result.stdout)
return True
else:
print("❌ Batch generation failed:")
print(result.stderr)
return False
except Exception as e:
print("❌ Error during batch generation: {}".format(e))
return False
def guide_automation(self):
"""Guide user through automation process."""
print("\n🤖 STEP 5: Running your digital decluttering...")
time.sleep(1)
print("🚀 This is where the magic happens!")
print(" The system will automatically unfollow accounts")
print(" that don't add value to your life.")
print()
# Get credentials
while True:
username = input("📱 Enter your Instagram username: ").strip()
if username:
break
print("❌ Please enter a valid username.")
while True:
password = input("🔐 Enter your Instagram password: ").strip()
if password:
break
print("❌ Please enter a valid password.")
print("\n⚠️ IMPORTANT SAFETY & LEGAL NOTES:")
print(" - EDUCATIONAL PURPOSE ONLY: This is for learning/research")
print(" - ACCOUNT RISKS: May result in restrictions or bans")
print(" - USER RESPONSIBILITY: You assume all risks")
print(" - The system uses human-like delays (5-15 seconds)")
print(" - Maximum 30 accounts per run (safe limit)")
print(" - Monitors for rate limits automatically")
print(" - Your credentials are only used for unfollowing")
print(" - You must comply with Instagram's Terms of Service")
print()
confirm = input("🤔 Ready to start your digital decluttering? (y/n): ").lower()
if confirm != 'y':
print("👋 No problem! Come back when you're ready.")
return False
print("\n🚀 Starting your digital decluttering...")
print(" This may take a few minutes...")
print()
try:
import subprocess
result = subprocess.run([sys.executable, "auto_unfollow.py", username, password],
capture_output=True, text=True)
print("📊 RESULTS:")
print(result.stdout)
if result.returncode == 0:
print("🎉 SUCCESS! Your digital decluttering is complete!")
return True
else:
print("❌ Some issues occurred:")
print(result.stderr)
return False
except Exception as e:
print("❌ Error during automation: {}".format(e))
return False
def show_completion(self):
"""Show completion message and next steps."""
print("\n" + "🎉"*20)
print(" DIGITAL DECLUTTERING COMPLETE!")
print("🎉"*20)
print()
print("✨ Congratulations! You've successfully:")
print(" ✅ Cleaned up your Instagram following list")
print(" ✅ Removed accounts that don't serve you")
print(" ✅ Created space for meaningful connections")
print(" ✅ Improved your digital well-being")
print()
print("🔄 NEXT STEPS:")
print(" 1. Check your Instagram - see the difference!")
print(" 2. Run this again tomorrow for more cleanup")
print(" 3. Consider unfollowing more accounts manually")
print(" 4. Focus on accounts that truly inspire you")
print()
print("💡 TIP: Run this daily until your following list")
print(" contains only accounts that add value to your life.")
print()
print("🌟 You're one step closer to a decluttered, focused life!")
def run_foolproof_guide(self):
"""Run the complete foolproof guide."""
self.print_header()
# Step 1: Check prerequisites
if not self.check_prerequisites():
print("\n🔄 Please fix the setup issues and run this again.")
return False
# Step 2: Guide data export
if not self.guide_data_export():
print("\n🔄 Please get your Instagram data and run this again.")
return False
# Step 3: Guide classification
if not self.guide_classification():
print("\n🔄 Please fix the classification issues and run this again.")
return False
# Step 4: Guide batch generation
if not self.guide_batch_generation():
print("\n🔄 Please fix the batch generation issues and run this again.")
return False
# Step 5: Guide automation
if not self.guide_automation():
print("\n🔄 Please try the automation again when ready.")
return False
# Show completion
self.show_completion()
return True
def main():
"""Main entry point for foolproof guide."""
guide = FoolproofGuide()
guide.run_foolproof_guide()
if __name__ == "__main__":
main()