Giter Site home page Giter Site logo

yorkulibraries / yudlbot Goto Github PK

View Code? Open in Web Editor NEW
5.0 6.0 5.0 24 KB

Bots that tweets random York University Digital Library content.

Home Page: https://twitter.com/YUDLbot

License: The Unlicense

Python 100.00%
bot python twitter-bot islandora

yudlbot's Introduction

YUDLbot

Overview

A bot that tweets random York University Digital Library content. You can find implementations at:

If you want use it, you will need to setup the variables outlined in config.py.example and rename it to config.py. You will also need a Solr query. These queries from an Islandora 7.x instance. Feel free to crib from the example queries in the repo:

You can automate it with a cron job like so:

17 */5 * * * /usr/bin/python /path/to/YUDLbot.py

License

Public Domain

yudlbot's People

Contributors

bondjimbond avatar deantiquate avatar ruebot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

yudlbot's Issues

Example SOLR_DATA for Config file

I'm trying to create a bot for my own repository, but seem to be getting a set of errors which I think may be related to not understanding exactly what I should be entering here as my Solr query.

Test query: http://arcabc.ca/islandora/search/asshole?type=dismax&fl=PID%2C+mods_titleInfo_title_ms&wt=json&indent=true&rows=15

File "YUDLbot.py", line 13, in
data = json.loads(response.read())
File "/usr/lib/python2.7/json/init.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

Could you perhaps post an example valid Solr query for this field in the Readme, such as the one powering YUDLbot? (Or perhaps my query is already formatted correctly and I'm getting the error for a different reason?)

No longer working after July 15?

After July 15, the bot has stopped working. Now running YUDLbot.py throws the following error:

File "YUDLbot.py", line 12, in
docs = data["response"]["docs"]
TypeError: 'int' object has no attribute 'getitem'

Could this be due to credentials expiring, a change in the way the Twitter API provides data, or something else?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.