Example #1
0
    def marked_as_spam(self, comment, request):
        key = self._get_key()
        if not key:
            return

        try:
            if verify_key(key, comment.site.domain):
                data = self._get_data_from_comment(comment)
                submit_spam(key, comment.site.domain, **data)
        except AkismetError, e:
            print e.response, e.statuscode
Example #2
0
def send_spam():
    spams = [
        'Not in at the moment http://anestasiavodka.com/blog/how-to-use-mastigra-100/ mastigra price  This is what differentiates Americans, American foreign policy and our reaction to 9/11. This Americanism was at the core of the Bush Doctrine and is the ultimate legacy that will dominate American discussion of foreign policy for this entire century.',
        '''I like it a lot http://anestasiavodka.com/blog/how-to-use-mastigra-100/ mastigra 120 tabletki  Police had traveled to St. Augustine, Fla., to look for Ferrante, a leading researcher on Lou Gehrig's disease. But Allegheny County district attorney's office spokesman Mike Manko and police said Ferrante was arrested near Beckley, W.Va., by state police.'''
    ]

    for spam in spams:
        try:
            akismet.submit_spam(my_api_key, "illustrationarchive.cardiff.ac.uk",
                                "127.0.0.1", "Mozilla/5.0 (...) Gecko/20051111 Firefox/1.5",
                                comment_content=spam)
        except Exception as e:
            print e
Example #3
0
    def _submit_comment_to_akismet(self, text, status):
        """
        Submit spam comment to akismet
        """
        site = self.getSitePath()
        user_agent = self.REQUEST.get('HTTP_USER_AGENT', '')
        user_ip = self.REQUEST.get('REMOTE_ADDR', '127.0.0.1')
        text = unidecode(text)

        if has_api_key and akismet_api_key:
            if akismet.verify_key(akismet_api_key, site):
                if status:
                    akismet.submit_spam(akismet_api_key, site, user_ip, user_agent,
                                        comment_content=text)
                else:
                    akismet.submit_ham(akismet_api_key, site, user_ip, user_agent,
                                        comment_content=text)
Example #4
0
    def _submit_comment_to_akismet(self, text, status):
        """
        Submit spam comment to akismet
        """
        site = self.getSitePath()
        user_agent = self.REQUEST.get('HTTP_USER_AGENT', '')
        user_ip = self.REQUEST.get('REMOTE_ADDR', '127.0.0.1')
        text = unidecode(text)

        if has_api_key and akismet_api_key:
            if akismet.verify_key(akismet_api_key, site):
                if status:
                    akismet.submit_spam(akismet_api_key,
                                        site,
                                        user_ip,
                                        user_agent,
                                        comment_content=text)
                else:
                    akismet.submit_ham(akismet_api_key,
                                       site,
                                       user_ip,
                                       user_agent,
                                       comment_content=text)