UNPKG

node-red-contrib-twitter-2.0

Version:
58 lines (46 loc) 2.27 kB
<script type="text/x-red" data-template-name="twitter-user"> <div class="form-row"> <label for="node-input-creds"> Credentials</label> <input type="text" id="node-input-creds"> </div> <!-- By convention, most nodes have a 'name' property. The following div --> <!-- provides the necessary field. Should always be the last option --> <div class="form-row"> <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Name of this Event"> </div> <div class="form-row"> <label for="node-input-screen_name">Screen Name</label> <input type="text" id="node-input-screen_name" placeholder="redconnectapp"> </div> </script> <!-- Next, some simple help text is provided for the node. --> <script type="text/x-red" data-help-name="twitter-user"> <h3>About</h3> <p>Returns a variety of information about the user specified by the required screen name parameter. The author’s most recent Tweet will be returned inline when possible.</p> <h3>Use</h3> <p>To use either configure the form or pass the screen name as a parameter inside the payload object ({"screen_name"":"redconnectapp"}). </p> <p>For more information on these parameters see the twitter API:</p> <p><a href="https://dev.twitter.com/rest/reference/get/users/show" target="_blank">users/show</a></p> </script> <!-- Finally, the node type is registered along with all of its properties --> <!-- The example below shows a small subset of the properties that can be set--> <script type="text/javascript"> RED.nodes.registerType('twitter-user', { category: 'social', defaults: { creds: {value:"", type:"twitter-client"}, name: {value:""}, screen_name: {value:""} }, inputs:1, // set the number of inputs - only 0 or 1 outputs:1, // set the number of outputs - 0 to n icon: "twitter.png", // saved in icons/myicon.png color: "#C0DEED", label: function() { return this.name || "User"; }, paletteLabel: "User" }); </script>