Creating a shortcode in a plugin that includes JS

Hook function name should be same. You are using “tweets” function name as a parameter for the add_shortcode() function but actual function name in your code is “tweet_code” so it should be “tweets” as shown in the following code.

<?php
add_shortcode( 'tweet', 'tweets' );
function tweets( $atts ) {
$tweet_text = <<<'EOD'
<!-- Tweet JS. Do not edit. -->
<script LANGUAGE="JavaScript"  TYPE="text/javascript" async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<!-- end  Tweet JS tag -->
EOD;
return $tweet_text;
}
?>

For more information on add_shortcode function visit this page.