This is my first attempt at anything module-related with Drupal.
I used the Digg module for Activity Stream to create my own Google Reader Shared Items module.
The problem is that the Activity Stream nodes are being created, but they are not showing up in the actual activity stream.

I'm attaching the module. I wanted to create a special module for this so that it would read "...shared..." and have the Google Reader icon displayed.

What am I doing wrong?

Comments

dmetzcher’s picture

Actually, it's working now, so that's good.
The icon isn't showing up, however....
Is there a reason that this might happen. Things are set up just like the Digg module with regard to the icon itself.

akalsey’s picture

I don't see anything wrong with the code. Do you see any errors in Drupal's log or in your web server's error log?

dmetzcher’s picture

I uninstalled Activity Stream...
Then deleted all nodes that had been created.
Then I reinstalled Activity Stream...
Then I set it up with no feeds...just the modules it comes with and my Google Reader Shared Items module.

No icon though for the Google Reader nodes.
And Twitter stopped working this time. My updates didn't get imported again. This is the first time this has happened. The last time I uninstalled and reinstalled, Twitter and everything else came back.

What can I do to completely get rid of it and start over with the Activity Stream module? (So it's clean.)
I have a feeling that something is hanging around and causing issues. I wish I had a test site.

dmetzcher’s picture

I uninstalled Activity Stream and deleted all nodes that had been created.
I saw that there was an update as of 6 August 2008, so I updated the module itself.
I reinstalled Activity Stream.
I activated the Twitter module only.
Now cron.php is running really fast, like it's not doing anything. I've never seen this before. It did just check my aggregator feeds when it ran on schedule, however, so it's working.

I think I broke something. :(
Twitter isn't updating at all.

dmetzcher’s picture

The activitystream_accounts table shows this for the Twitter lastfetch field: 0000-00-00 00:00:00.
I don't see anything in my Drupal logs.

dmetzcher’s picture

Hey...could it be the cache table? I know I've had to clear it in the past for other things. I wonder, because I just posted to Twitter and it showed up in my aggregator feed that I have set up for Twitter.

dmetzcher’s picture

Used the Devel module to clear the cache. The last post to Twitter was picked up. But, there is a bullet item just above it that is blank. Weird.

Also, it didn't pick up the posts before the latest one (which I posted a few minutes ago).

akalsey’s picture

Anything that gets data from a feed (in the default download that's everything except Flickr) is cached for 1 hour on the filesystem. If you delete the contents of your Drupal tmp directory the cache files will be gone. Or just wait an hour or two after the last fetch.

When you removed the module, did you run the uninstaller? Or just disable and delete the module? If you ran the uninstaller, it should have deleted the activitystream_accounts and activitystream tables. Those contain the list of nodes that have already been imported. If there's anything in those tables, those items won't be imported again.

dmetzcher’s picture

I ran the uninstaller. Both tables were deleted.
Where is the tmp directory? I can look in there.

dmetzcher’s picture

I read in a few places that the tmp directory is at the root of my Drupal installation. If this is true, I don't have one.

akalsey’s picture

It's whatever you have set in /admin/settings/file-system

dmetzcher’s picture

File System Path:
sites/default/files

Temporary Directory:
/tmp

But this directory exists no where on my server. It's simply not there. Is this a problem? Should I create it? If yes, where, in sites/default/files/tmp, or at the root of the site?

akalsey’s picture

Is this a unix server or a Windows server?

dmetzcher’s picture

Unix.

akalsey’s picture

Then you have /tmp. Your server wouldn't work without it. It's not in your Drupal path. It's at the root of your server, not your web site.

dmetzcher’s picture

Any other idea what could be causing what I'm seeing then?

I've uninstalled the module.
I've deleted the Activity Stream nodes.
I've reinstalled the module.
I've activated only Twitter.
I've waited for the updates to come down (several hours).

Is there another location, somewhere, where you are storing something that is preventing a reinstall of the module from getting the old data from Twitter that was there before I uninstalled it? Uninstalling and reinstalling is not cleaning something up.

Or, could the module be causing some kind of issue with my Drupal installation that it's not cleaning up or undoing when it is uninstalled?

I know I'm grasping at straws here, but, based on what you have said, this should not be happening if I uninstall and reinstall it cleanly.

Where are the settings, like Twitter username, stored? I noticed that they are always there when I reinstall. Could this have something to do with it?

dmetzcher’s picture

I found out what those bullets are with nothing next to them...the dates. The dates are no longer displaying. Last.fm still works, but Twitter still doesn't.

akalsey’s picture

The module stores nothing at all in the cache tables. All data is stored in node, activitystream, and activitystream_accounts.

If the account info was still in the activitystream tab, then the uninstaller didn't run. The only place that's stored is in activitystream_accounts and that table is deleted when you run the uninstaller.

To clear all data that activity stream adds, you can delete all rows from node and node_revisions where type is "activitystream" and empty both activitystream tables. The cache will take care of itself after a bit, or you can delete *.spc from /tmp. Keep in mind that it's possible that something other than Activity Stream writes .spc files to /tmp on your system and I can't guarantee for certain that deleting these will be safe.

dmetzcher’s picture

The Twitter stream is working now.
I guess it just takes forever for that /tmp folder to clear out.

The issue with the dates not showing up is there there, however.
I have a bullet point at the head of a group of items, where the date for that group should be, but it's not there. Is there anything that I can check to get the dates working again?

Thanks!

dmetzcher’s picture

Actually, regarding the date headers, it looks like there is a patch.
http://drupal.org/node/292692

dmetzcher’s picture

I'm afraid to install my Google Shared Items module again (the original reason for this thread)...since the last time I wasn't getting the icons. You really didn't see anything wrong with the code? Are you able to test it out (if not, I totally understand, since you may not have a test server -- I don't -- and I understand if you don't want to use the module).

Thanks.

dmetzcher’s picture

StatusFileSize
new38.17 KB

This version of the Google Reader Shared Items module will work and the icon will display. eojthebrave corrected the issue with the icon (wrong image format).

Something occurred to me, however. Since the Activity Stream module re-posts whatever is included, it is reposting the full article from the Google Reader feed. This is copyright infringement, so I'd like to edit the Shared Items module to only post the first few words of the item. Is this possible?

eojthebrave’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new36.19 KB

I've attached a version that fixes the issue mentioned in #22. This new version trims the body of the node to 150 characters.

I'm also going to mark this as RTBC as it's been working fine in my testing and my change is a very minor one.

dmetzcher’s picture

Very nice. Thanks, eoj!

akalsey’s picture

Status: Reviewed & tested by the community » Closed (fixed)

If you apply for a Drupal CVS account you can add this module as a project. I've added a link to the main project page to the comment with the current attachment. After this is a full-fledged Drupal project, leave a comment here with the project url and I'll update the link to point there.

thomas23@drupal.org’s picture

Would it be possible to add this as a "official" sub-module, please? I'm asking this so Drupal can know about updates to it.

dmetzcher’s picture

I'll apply for an account and add this as a project.
I also created a few more: Pandora (bookmarked artists and songs), Pownce, and I'm working on a YouTube (uploads) module right now, which should be done in a few minutes.

I'll post the links to the projects after I apply for an account and create them.

Thanks!

dmetzcher’s picture

I have applied for CVS access.
I've also created two more modules: YouTube Uploads and Tumblr Blog integration.
Once my application is approved, I'll create the projects and post the links back here.

thomas23@drupal.org’s picture

Hi.

That sounds great! While you're at it would it be possible to add an option for multiple accounts for one user? E.g. if you have multiple Tumblr Blog accounts to add all of them? Unfortunatelly I don't have the time myself but would find it really neat to have something like a possibility to have multiple wordpress accounts that I have to be shown in The Stream tm. Right now this works with activity stream's feeds module but not as a seperate wordpress stating something like "so-and-so blogged on " for an individual blog.

Thanks anyways for your effort so far!

Cheers.

dugh’s picture

It should be noted this only works with drupal 6.

I changed activitystream_greadershared.info to this:

name = Google Reader Shared Items
description = What's been shared
dependencies = activitystream activitystream_feed
package = Activity Stream

geodaniel’s picture

dmetzcher, did you get a CVS account to add this new project?

KrisBulman’s picture

Any progress on a CVS account?

canadrian’s picture

Status: Closed (fixed) » Active

Activity Stream doesn't seem to be pulling in my Google Reader Shared items anymore. Is there any update on whether this is becoming a full module?

dmetzcher’s picture

Actually, I've shut the site down that was using Activity Stream... but, now that I think of it, I'm not sure that my CVS account was approved or not. I cannot remember. Anyone know how I can check?

joecanti’s picture

Hi dmetzcher, any chance I could have a play around with your tumblr add on module? I've been searching for a good Tumblr solution for ages and this could be perfect!

Thanks, Joe

dmetzcher’s picture

StatusFileSize
new104.74 KB

Sure. I'm attaching it, along with any others I wrote. I no longer use them, and the code is old, but here you go... ;-)

Here's what I found (I forgot that I'd even created several of these):

  • activitystream_friendfeedlikedtopics
  • activitystream_friendfeedpostedtopics
  • activitystream_greadershared
  • activitystream_pandorabookmarkedartists
  • activitystream_pandorabookmarkedsongs
  • activitystream_pownce
  • activitystream_tumblr
  • activitystream_yelp
  • activitystream_youtubeuploads

I'm pretty sure I got them all working, but no guarantees... it's been a long time. Test them and try them out. Enjoy!

joecanti’s picture

Thanks very much dmetzcher - the Tumblr sub module worked great!!

I've been trying for ages to find a good way of aggregating my tumblr feed and now I have it!

cheers, Joe

dmetzcher’s picture

Joe: Glad to hear it worked for you. I wasn't sure what state the modules were in since it's been so long since I'd used them myself. :-)

imDhaval’s picture

sub