title: Integrating SpamAssassin with my PHP application
body: <p>I've build a web app using PHP which gets a number of posts containing a keyword like 'pizza' from Instagram and loads them up with some other data to MongoDB.</p>
  <p>One of the modules is Python's NLTK and here's how I invoke it (yes, I am switching languages like crazy [just to study them]):</p>
  <pre><code>$foo = exec(&quot;python tokenize.py $bar&quot;);
  </code></pre>
  <p>Now the line above is fully working, but I am looking for a similar way to call my SpamAssassin to check if the content of the Instagram post is a spam or not. Judging from the documentation of SA, I know it is possible to check some plain text files as they were mails <a href="http://spamassassin.apache.org/full/3.3.x/doc/spamassassin-run.html" rel="nofollow noreferrer">like here</a>. I am new to SA though.</p>
  <p>Probably this question is pretty simple for advanced SA users, but I cannot tell any input-output option in SA from cmd like in the PHP-to-Python call like above. Assuming that <code>$string</code> is the content of the Instagram post, I am looking for some script like that:</p>
  <pre><code>$score_of_SA = exec(&quot;spamassassin.exe $string&quot;)
  </code></pre>
  <p><strong>Is any script like that possible in PHP? If not, what do I have to do to check that content?</strong></p>
  <p>Assume my SA is updated and trained.</p>