Skip to content

Instantly share code, notes, and snippets.

View a-fro's full-sized avatar

Aaron Froehlich a-fro

  • Cornell University
  • Ithaca, NY
View GitHub Profile
name = Bean Tweets
description = Provides a block for a twitter user's tweets
core = 7.x
dependencies[] = bean
package = Bean
files[] = "plugins/bean/bean_tweets.tweet_block.inc"
configure = admin/config/system/bean_tweets
@a-fro
a-fro / gist:5221384
Last active December 15, 2015 07:09
<?php
/**
* @file
* Bean plugin for showing tweets for a specified twitter user
*/
/**
* Implements hook_bean_types_api_info().
*/
function bean_tweets_bean_types_api_info() {
@a-fro
a-fro / gist:5222565
Last active December 15, 2015 07:19
<?php
/**
* @file
* Tweet block bean plugin.
*/
/**
* Require the twitteroauth library
*/
require_once(drupal_get_path('module','bean_tweets') . '/libraries/twitteroauth/twitteroauth.php');
$conf['twitter_consumer_key'] = [consumer_key_here];
$conf['twitter_consumer_secret'] = [consumer_secret_here];
$conf['twitter_access_token'] = [access_token_here];
$conf['twitter_token_secret'] = [token_secret_here];
<?php
/**
* @file
* Bean admin page for setting up oAuth
*/
/**
* Admin form.
*/
function bean_tweets_admin($form, &$form_state) {
<?php
/**
* Implements hook_uninstall().
*/
function bean_tweets_uninstall() {
variable_del('twitter_consumer_key');
variable_del('twitter_consumer_secret');
variable_del('twitter_access_token');
variable_del('twitter_token_secret');
<?php
/**
* Implements hook_menu().
*/
function bean_tweets_menu() {
$items = array();
$items['admin/config/system/bean_tweets'] = array(
'title' => t('Bean Tweets OAuth'),
'description' => t('Configure OAuth for Bean Tweets module'),
'page callback' => 'drupal_get_form',
<?php
/**
* @file
* Tweet block bean plugin.
*/
/**
* Require the twitteroauth library
*/
require_once(drupal_get_path('module','bean_tweets') . '/libraries/twitteroauth/twitteroauth.php');
<?php
/**
* @file
* Tweet block bean plugin.
*/
/**
* Require the twitteroauth library
*/
require_once(drupal_get_path('module','bean_tweets') . '/libraries/twitteroauth/twitteroauth.php');
h1 {
font-size: 2em;
font-weight: normal;
&.yell {
text-decoration: uppercase;
font-weight: bold;
}
}