Giter Site home page Giter Site logo

Comments (18)

giga-a avatar giga-a commented on May 23, 2024 2

Glad it worked! and feel free to share!

By the way, the sa object has a lot of features that you can turn on run_as_object(cli=False, gui=False, logs_dir='', logs=False, extract=False, filter='good', headers={}, list=False, metadata=False, method='all', mode='fast', options='', output='pretty', profiles='detected', type='all', ret=False, silent=False, timeout=0, trim=False, username='', websites='all', countries='all', top='0', screenshots=False )

from social-analyzer.

giga-a avatar giga-a commented on May 23, 2024 1

Hey @100wood thanks for sharing! I'm looking..

from social-analyzer.

giga-a avatar giga-a commented on May 23, 2024

Done, it will be pushed in the new update!

from social-analyzer.

giga-a avatar giga-a commented on May 23, 2024

@100wood, pushed in social-analyzer==0.40

It should be completely silent

def soc_analyzer_task(username):
SocialAnalyzer = import_module("social-analyzer").SocialAnalyzer()
results = SocialAnalyzer.run_as_object(username=username, silent=True)
return results

Let me know if it works or not!

from social-analyzer.

100wood avatar 100wood commented on May 23, 2024

Hi @giga-a ,

thank you for your quick response. I appreciate that. Unfortunately, it doesn't bring the expected improvement.

I implemented the function like above. Here is what I have in my terminal.


[2022-02-16 09:26:03,272: INFO/MainProcess] [Init] Selected websites: 999
[2022-02-16 09:26:03,273: INFO/MainProcess] [Info] username: johndoe
[2022-02-16 09:26:03,471: INFO/MainProcess] [Checking] 24.wikia.com
[2022-02-16 09:26:03,476: INFO/MainProcess] [Checking] 9gag.com
[2022-02-16 09:26:03,482: INFO/MainProcess] [Checking] 8tracks.com
[2022-02-16 09:26:03,487: INFO/MainProcess] [Checking] about.me
[2022-02-16 09:26:03,491: INFO/MainProcess] [Checking] akbrny.com
[2022-02-16 09:26:03,494: INFO/MainProcess] [Checking] adultism.com
[2022-02-16 09:26:03,587: INFO/MainProcess] [Checking] airliners.net
etc

from social-analyzer.

giga-a avatar giga-a commented on May 23, 2024

Hey @100wood! I checked and I did not get the same results (The logger did not turn on).. what is the social-analyzer version?

pip3 show social-analyzer

from social-analyzer.

100wood avatar 100wood commented on May 23, 2024

Hm, that's weird and makes it more difficult to solve -.-

(venv) C:\tmp\project>pip3 show social-analyzer
Name: social-analyzer
Version: 0.40
Summary: API, CLI & Web App for analyzing & finding a person's profile across 300+ social media websites (Detections are updated regularly)
Home-page: https://github.com/qeeqbox/social-analyzer
Author: QeeqBox
Author-email: [email protected]
License: AGPL-3.0
Location: c:\tmp\project\venv\lib\site-packages
Requires: BeautifulSoup4, tld, requests, lxml, termcolor, galeodes, langdetect
Required-by:

from social-analyzer.

giga-a avatar giga-a commented on May 23, 2024

@100wood - Ohh, I did not check that on windows! let me check..

from social-analyzer.

100wood avatar 100wood commented on May 23, 2024

@giga-a It may be the same behavior in linux as well because in productive mode im running the celery worker in a docker container.

from social-analyzer.

giga-a avatar giga-a commented on May 23, 2024

@100wood okay, thanks for letting me know - do you know what distro\version of Linux, so I check that too?

from social-analyzer.

100wood avatar 100wood commented on May 23, 2024

PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

from social-analyzer.

giga-a avatar giga-a commented on May 23, 2024

Hey @100wood! I tested social-analyzer 0.40 on both Debian 10 and windows 10, the switch silent worked as expected.

test

I'm not entirely sure why the output keeps showing up in your devices, but what I'm going to do is implementing a different method of disabling the output (Hopefully it works!)

from social-analyzer.

giga-a avatar giga-a commented on May 23, 2024

Pushed 0.41, this one has logic that adds null handler when silent is True

        if argv.silent:
            self.log.addHandler(NullHandler())
        else:
            self.log.addHandler(CustomHandler(argv, sa_object=self))

Try and let me know if it works or not!

from social-analyzer.

100wood avatar 100wood commented on May 23, 2024

Many thanks for your persistence with this issue. Unfortunately, my celery worker still brings the output... ๐Ÿ˜ญ

[2022-02-21 10:38:51,802: INFO/MainProcess] Task tools.tasks.soc_analyzer_task[154bf2a3-c0a8-4e95-b9f3-6c078a1108c8] received
[2022-02-21 10:38:51,876: INFO/MainProcess] [init] Detections are updated very often, make sure to get the most up-to-date ones
[2022-02-21 10:38:51,889: INFO/MainProcess] [init] languages.json looks good!
[2022-02-21 10:38:51,890: INFO/MainProcess] [init] sites.json looks good!
[2022-02-21 10:38:51,926: INFO/MainProcess] [init] languages.json & sites.json loaded successfully
[2022-02-21 10:38:51,927: INFO/MainProcess] [Init] Selected websites: 999
[2022-02-21 10:38:51,927: INFO/MainProcess] [Info] username: janedoe
[2022-02-21 10:38:52,152: INFO/MainProcess] [Checking] about.me
[2022-02-21 10:38:52,241: INFO/MainProcess] [Checking] airlinepilot.life
[2022-02-21 10:38:52,378: INFO/MainProcess] [Checking] 7cups.com
[2022-02-21 10:38:52,419: INFO/MainProcess] [Checking] 8tracks.com
[2022-02-21 10:38:52,422: INFO/MainProcess] [Checking] 9gag.com
[2022-02-21 10:38:52,440: INFO/MainProcess] [Checking] admireme.vip
[2022-02-21 10:38:52,443: INFO/MainProcess] [Checking] adultism.com
[2022-02-21 10:38:52,446: INFO/MainProcess] [Checking] airliners.net
[2022-02-21 10:38:52,479: INFO/MainProcess] [Checking] 500px.com
[2022-02-21 10:38:52,489: INFO/MainProcess] [Checking] 24.wikia.com
[2022-02-21 10:38:52,521: INFO/MainProcess] [Checking] airbit.com
[2022-02-21 10:38:53,246: INFO/MainProcess] [Checking] akniga.org
[2022-02-21 10:38:53,249: INFO/MainProcess] [Checking] aahachat.org
[2022-02-21 10:38:53,252: INFO/MainProcess] [Checking] adore.one
[2022-02-21 10:38:53,254: INFO/MainProcess] [Checking] akbrny.com
[2022-02-21 10:38:53,864: INFO/MainProcess] [Checking] algowiki-project.org
[2022-02-21 10:38:54,071: INFO/MainProcess] [Checking] alleywatch.com
[2022-02-21 10:38:54,076: INFO/MainProcess] [Checking] alik.cz
[2022-02-21 10:38:54,293: INFO/MainProcess] [Checking] alimero.ru
[2022-02-21 10:38:54,605: INFO/MainProcess] [Checking] aliveshoes.com

Maybe this is caused more by my settings in celery. I have also included other tools like maigret or holehe. The suppression there works fine so I thought the issue must be located here in sa. I will go deeper into celery logging, maybe there is something wrong configured. I will come back to you when I make progress.

from social-analyzer.

giga-a avatar giga-a commented on May 23, 2024

@100wood I'm going to push a new update with different logging mechanism, hopefully it works! The new logic will be something like this:

if this.logging_on_off:
    this.log()

So, print output will not be triggered unless this.logging_on_off is True

This means you will be able to do this

SocialAnalyzer = import_module("social-analyzer").SocialAnalyzer()
SocialAnalyzer.logging_on_off = False
results = SocialAnalyzer.run_as_object(username=username, silent=True)

I'm also going to setup it in a celery task and check that!

from social-analyzer.

100wood avatar 100wood commented on May 23, 2024

Wow, big big thank you. Your service and support is incredible. ๐Ÿ‘
I appreciate your help! :-)

from social-analyzer.

giga-a avatar giga-a commented on May 23, 2024

Pushed as 0.42

from importlib import import_module
SocialAnalyzer = import_module("social-analyzer").SocialAnalyzer(silent=True)
SocialAnalyzer.silent = True
results = SocialAnalyzer.run_as_object(username="test", websites="car", silent=True)
print(results)

There are a pre-checks before all print output routines (E.g.)

if not self.silent: self.log.info('[init] Temporary Logs Directory {}'.format(temp_folder))

If this does not work, then it might be that the social-analyzer version is not 0.42 on the end where the celery task is running.

If you still have issue do this SocialAnalyzer.log = None instead of SocialAnalyzer.silent = True and tell me what's the output.

from social-analyzer.

100wood avatar 100wood commented on May 23, 2024

@giga-a Big Thank You for your quick response.
This time it works perfectly. ๐Ÿ‘
I used your recommended code:

from importlib import import_module
SocialAnalyzer = import_module("social-analyzer").SocialAnalyzer(silent=True)
SocialAnalyzer.silent = True
results = SocialAnalyzer.run_as_object(username="test", websites="car", silent=True)
print(results)

And I get the output I wanted:

[2022-02-24 09:40:37,684: INFO/MainProcess] tools.tasks.schedule_task[28eded79-880e-416b-b6cc-4cf6a9bf67b8]: Let's work on social_analyser, with value: harry_the_potter
[2022-02-24 09:40:39,705: INFO/MainProcess] Task tools.tasks.soc_analyzer_task[1b6dad49-791b-4f47-ad06-5037bbebe25a] received
[2022-02-24 09:44:11,746: INFO/MainProcess] Task tools.tasks.soc_analyzer_task[1b6dad49-791b-4f47-ad06-5037bbebe25a] succeeded in 212.03099999995902s

This is a great project and I hope you have fun developing it further for a long time to come ;-) :-)

from social-analyzer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.