Loading...
Logo
Processing Forum
ecocat's Profile
2 Posts
4 Responses
0 Followers

Activity Trend

Last 30 days
Show:
Private Message
    I am trying to understand how best to secure my key data. My sketch must exist on my website as an applet that accesses twitter in real-time. My sketch involves the following method:

    static String OAuthConsumerKey = "XXXXXXXX";
    static String OAuthConsumerSecret = "XXXXXXXXXXXXXXX";
    static String AccessToken = "XXXXXXXXXXXXXXX";
    static String AccessTokenSecret = "XXXXXXXXXXXXXXX";

    I understand that if I simply keep the key data in my applet it will be a security compromise as a user could peek inside of it. How then do I best hide these keys, i.e. in a php file and then call it into the applet? How then would I read the php securely into the applet without users seeing my key?
    Trying to devise a way to flash the background for 5 seconds and then display a tweet text onscreen for 5 seconds sans the flashing background. I know I am close but I am entirely stumped as to how best tweak my second if statement so that it delays the flashing and lets the text from the tweet I am grabbing via DisplayTweets(); exist uninterrupted for five seconds and then repeat the whole process again. Thanks in advance for your ideas.

    int timeDelay = 5000; //milliseconds in one minute
    int lastTime = 0;

    void setup() {
     
      size(1024,780);
      background(152,152,152);
      connectTwitter();
      getSearchTweets();
      // DisplayTweets();
      lastTime = millis();
      rectMode(CORNER);
      // noLoop();
    }
     
    void draw() { 
      if(millis()-lastTime<=timeDelay){
      rectMode(CORNER);
      float m = millis();
      fill(m % 255);
      rect(0, 0, 1024, 780);
      lastTime=millis();

    }

    if(millis()-lastTime>=timeDelay){
       // background(152,152,152);
        DisplayTweets();
        lastTime=millis();
      }
     
    }